[KinoSearch] question on querying by url
Marvin Humphrey
marvin at rectangular.com
Fri Apr 21 17:33:17 PDT 2006
On Apr 18, 2006, at 4:46 AM, Filippo A. Salustri wrote:
> Doesn't this assume the PolyAnalyzer was called? "analyzed" was on
> originally, but before I did the tests I reported, I'd turned it
> off for the 'url' field with "analyzed=>0" in spec_field. My
> understanding is that in that case, the PolyAnalyzer wouldn't be
> called, even if QueryParser was on duty.
When you say "turned it off", do you mean that you regenerated the
entire index from scratch?
The QueryParser doesn't know whether a field was analyzed or not at
index-time. Whatever analyzer you supply to QueryParser is always
used, regardless of whether it is using the default field, or whether
it is using a field which has it parsed out of a "fieldname:termtext"
construct.
Behind the scenes in the Searcher, when you supply a query string
instead of a full Query object to search(), it actually creates
several QueryParsers -- one for each indexed field. Each one of
these QueryParsers uses the supplied Analyzer. All of the Query
objects that these QueryParsers generate are fused together into a
big BooleanQuery, and search() returns the results of that.
I've now added a new unit test, <http://www.rectangular.com/svn/
kinosearch/trunk/t/214-spec_field.t>, which tests for whether the
settings for "analyzed", "analyzer", and "indexed" are being obeyed.
It hasn't turned up any surprises... so far. :) Please let me know
if you experience unexpected behavior along these lines again.
Thanks for the feedback,
Marvin Humphrey
Rectangular Research
http://www.rectangular.com/
_______________________________________________
KinoSearch mailing list
KinoSearch at rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch
More information about the kinosearch
mailing list