app/views/search.py
def create_schema(self, flush=False):
        """
        Creates the Schema for the index. if flush is True this removes
        the old index if there was one.
        """
        from whoosh.fields import Schema
        from whoosh.fields import ID, KEYWORD, TEXT
        from shutil import rmtree

        schema = Schema(
            # Indexing
            index_id=ID(unique=True),
            # Identification
            id=ID(stored=True),
            type=ID(stored=True),
            # Searching
            name=TEXT,
            keywords=KEYWORD,
            defn=TEXT,
            desc=TEXT,
        )

        # Remove the old index if flushing
        if flush:
            rmtree(self._indexdir)

        # Create the folder if needed
        if not os.path.exists(self._indexdir):
            os.mkdir(self._indexdir)

        # make the actual index
        self.index = index.create_in(self._indexdir, schema)
        self.refresh_index()

        Creates the Schema for the index. if flush is True this removes
        the old index if there was one.
        
Creates the Schema for the index. if flush is True this removes
the old index if there was one.
Creates the Schema for the index . if flush is True this removes the old index if there was one .
def create_schema(self, flush=False):
        from whoosh.fields import Schema
        from whoosh.fields import ID, KEYWORD, TEXT
        from shutil import rmtree
        schema = Schema(
            index_id=ID(unique=True),
            id=ID(stored=True),
            type=ID(stored=True),
            name=TEXT,
            keywords=KEYWORD,
            defn=TEXT,
            desc=TEXT,
        )
        if flush:
            rmtree(self._indexdir)
        if not os.path.exists(self._indexdir):
            os.mkdir(self._indexdir)
        self.index = index.create_in(self._indexdir, schema)
        self.refresh_index()
def create_schema ( self , flush = False ) : from whoosh . fields import Schema from whoosh . fields import ID , KEYWORD , TEXT from shutil import rmtree schema = Schema ( index_id = ID ( unique = True ) , id = ID ( stored = True ) , type = ID ( stored = True ) , name = TEXT , keywords = KEYWORD , defn = TEXT , desc = TEXT , ) if flush : rmtree ( self . _indexdir ) if not os . path . exists ( self . _indexdir ) : os . mkdir ( self . _indexdir ) self . index = index . create_in ( self . _indexdir , schema ) self . refresh_index ( )
Creates the Schema for the index.
Creates the Schema for the index .
"""
        Creates the Schema for the index. if flush is True this removes
        the old index if there was one.
        """ # Indexing # Identification # Searching # Remove the old index if flushing # Create the folder if needed # make the actual index
self
flush