See my answer on how to do selective indexing in Bulbs without models...
And if you don't want to use the FulltextIndex
as the default index (presumably for performance reasons), you can manually put
the values to be indexed:
>>> from bulbs.neo4jserver import Graph, FulltextIndex
>>> from bulbs.element import Vertex
>>> index_name="fulltext_vertex"
>>> g = Graph()
>>> g.vertices.fulltext = g.factory.get_index(Vertex, FulltextIndex, index_name)
>>> james = g.vertices.create(name="James Thornton", city="Dallas")
>>> g.vertices.fulltext.put(james.eid, name=james.name)
>>> vertices = g.vertices.fulltext.query(name="James")
>>> vertices.next()
See...
And to automate the fulltext indexing behavior without making the fulltext index the default index, use a Bulbs Model
and create a custom Graph
object.
See my answer on how to customize Bulbs models...