I have a collection of documents and I want to create a search engine for my website. The documents are static and in another question, they suggested me Whoosh. However, I cannot even setup through the documentation help code.
from whoosh.fields import *
from whoosh.index import create_in
# Create an index
schema = Schema(content=TEXT)
ix = create_in("indexdir", schema)
writer = ix.writer()
writer.add_document(content=u"This is the first document we've added!")
writer.add_document(content=u"The second one is even more interesting!")
writer.commit()
And here is the Error:
ix = create_in("indexdir", schema)
File "build\bdist.win-amd64\egg\whoosh\index.py", line 90, in create_in
storage = FileStorage(dirname)
File "build\bdist.win-amd64\egg\whoosh\filedb\filestore.py", line 70, in __init__
raise IOError("Directory %s does not exist" % path)
IOError: Directory indexdir does not exist
Is there something else I have to add on indexdir?