Loosing fields?

2 views
Skip to first unread message

miki

unread,
Apr 6, 2009, 5:09:27 PM4/6/09
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

miki

unread,
Apr 6, 2009, 5:22:40 PM4/6/09
to xappy-discuss
Hello All,

> I'm creating a database using the following function:
> ...
My bad, a bug in my code.

Sorry for your time.
--
Miki
Reply all
Reply to author
Forward
0 new messages