1. Yuuki Ito
  2. memocurial

Commits

Yuuki Ito  committed 7fe7f8b

スキーマ変更

  • Participants
  • Parent commits 6f87166
  • Branches feature/whoosh-search

Comments (0)

Files changed (1)

File src/memocurial/script/__init__.py

View file
  • Ignore whitespace
 
             return s
 
-        schema = Schema(path=ID(stored=True, unique=True),
+        schema = Schema(fullpath=ID(stored=True),
+                        id=ID(stored=True),
                         body1=NGRAM(stored=True),
                         body2=NGRAMWORDS(stored=True))
 
 
         writer = ix.writer()
 
+        i = 1
         for searchpath, dirs, files in os.walk(repository_root):
             if 0 < len(files) and re.search(r"\.hg", searchpath) is None:
                 for f in files:
                     contents = get_lines(os.path.join(searchpath, f))
                     if (contents):
-                        writer.add_document(path=unicode(os.path.join(searchpath, f)),
+                        writer.add_document(fullpath=unicode(os.path.join(searchpath, f)),
+                                            id=unicode(searchpath.split("/")[-1]),
                                             body1=unicode(contents),
                                             body2=unicode(contents))