query_parse behavior

6 views
Skip to first unread message

Franz Zieher

unread,
Aug 22, 2009, 12:43:00 PM8/22/09
to xappy-discuss
I'm trying to use the supplied example code to index a view documents
and test the search behavior.

My index setup for the database is

iconn.add_field_action('name',xappy.FieldActions.INDEX_FREETEXT,
language='en')
iconn.add_field_action('name',xappy.FieldActions.STORE_CONTENT)

iconn.add_field_action
('description',xappy.FieldActions.INDEX_FREETEXT, language='en')
iconn.add_field_action
('description',xappy.FieldActions.STORE_CONTENT)

iconn.add_field_action
('content',xappy.FieldActions.INDEX_FREETEXT, language='en')
iconn.add_field_action('content',xappy.FieldActions.STORE_CONTENT)

iconn.add_field_action('author', xappy.FieldActions.INDEX_EXACT)
iconn.add_field_action('author', xappy.FieldActions.STORE_CONTENT)
iconn.add_field_action('author', xappy.FieldActions.SORTABLE)

iconn.add_field_action('date', xappy.FieldActions.INDEX_EXACT)
iconn.add_field_action('date', xappy.FieldActions.STORE_CONTENT)
iconn.add_field_action('date',
xappy.FieldActions.SORTABLE,type="float")

iconn.add_field_action('path', xappy.FieldActions.INDEX_EXACT)
iconn.add_field_action('path', xappy.FieldActions.STORE_CONTENT)

iconn.add_field_action('spath', xappy.FieldActions.INDEX_EXACT)
iconn.add_field_action('spath', xappy.FieldActions.STORE_CONTENT)
iconn.add_field_action('spath', xappy.FieldActions.SORTABLE)

iconn.add_field_action('project', xappy.FieldActions.INDEX_EXACT)
iconn.add_field_action('project',
xappy.FieldActions.STORE_CONTENT)
iconn.add_field_action('project', xappy.FieldActions.SORTABLE)

Searching in the database using

q = conn.query_parse(queryString)
res = conn.search(q,0,10)

does not return any results for queryString = 'author:zieherf'
although a number of documents have zieherf
as author assigned. Using conn.query_field does return the documents.
Is that behavior intended?
From the documentation on conn.query_parse I take it that the above
search should work. I tried this for
other fields with have INDEX_EXACT and found the same behavior.

...
The string passed to this method can have various operators in
it. In
particular, it may contain field specifiers (ie, field names,
followed
by a colon, followed by some text to search for in that field).
For
example, if "author" is a field in the database, the search string
could contain "author:richard", and this would be interpreted as
"search for richard in the author field". By default, any fields
in
the database which are indexed with INDEX_EXACT or INDEX_FREETEXT
will
be available for field specific searching in this way - however,
this
can be modified using the "allow" or "deny" parameters, and also
by the
allow_field_specific tag on INDEX_FREETEXT fields.
...

Any ideas what I'm doing wrong?

Franz
Reply all
Reply to author
Forward
0 new messages