miki
unread,Apr 6, 2009, 5:09:27 PM4/6/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to xappy-discuss
Hello,
I'm creating a database using the following function:
FREETEXT = xappy.FieldActions.INDEX_FREETEXT
STORE = xappy.FieldActions.STORE_CONTENT
EXACT = xappy.FieldActions.INDEX_EXACT
SORTABLE = xappy.FieldActions.SORTABLE
def create_db(path):
db = xappy.IndexerConnection(path)
def add(field, flags):
for flag in flags:
if type(flag) == tuple:
flag, kw = flag
else:
kw = {}
db.add_field_action(field, flag, **kw)
add("title", ((FREETEXT, {"weight" : 5}), STORE))
add("content", (FREETEXT, ))
for name in ("id", "tags", "source" , "companies", "people",
"locations"):
add(name, (EXACT, STORE))
add("time", (EXACT, STORE, (SORTABLE, {"type" : "float"})))
db.close()
However when I query the db for the fields it has I see on the
"content" field:
import sys
sys.path.append(".")
import xappy
db = xappy.SearchConnection(sys.argv[1])
print db._field_mappings._prefixes
Any ideas when am I missing?
Thanks,
Miki