Hi Mike,
OK, I guess my "problem" is more of a partially still coming up
to speed / partially wanting to be lazy.
If I make a dismax handler called "dissed", I'd like it to "work"
whether or not i pass in "commute" or "title:commute" to the query.
(Now I *do* realize those are two completely different kinds of
queries -- 1st would be all docs with "commute" in the default field
(which is most of our fields copied into it, so the document)
and the 2nd would be all docs with "commute" in the "title" field
(now that I've redone the field "type" to be "text" and not "string"
as Yonik pointed out)).
So this returns no documents because, I gather, you can't feed
the "field:value" lucene syntax directly in to a dismax handler
(although you can to a standard handler):
indent=on&fl=identifier&q=title:commute&qt=dissed
So I think simply my breaking up the queries from our search bar
(example "raw" formats:
grateful dead
"grateful dead"
mediatype:movies AND collection:prelinger )
into an expanded query of:
description:"[clause]"^10 text:"[clause]"^1 ....
fore each clause will work the best for us.
Is there any lucene or solr class / method that can break up
a string into clauses (eg: split on AND, OR, NOT, ()s, etc.)?
--tracey
Mike Klaas wrote:
On 12/5/06, Tracey Jaquith <[EMAIL PROTECTED]> wrote:
Now I have one new mystery that's popped up for me.
With std req handler, this simple query
q=title:commute
is *not* returning me all documents that have the word "commute" in the
title.
There must be some other filter/clause or something happening that
I'm not
aware of?
(For example, I do "indent=on&fl=title&q=commute" in a wget and grep the
results
for <title> and then grep -i for commute, there are 23 hits. But doing
"&q=title:commute" only returns one of those hits..)
Indeed--those are different queries. The "fl" parameter controlled
the stored fields returned by Solr; it does not affect which documents
are returned. The first query asks for the titles of all documents
containing the word "commute", the second for all documents with
"commute" in their title.
see http://wiki.apache.org/solr/CommonQueryParameters
I'm not sure what problems you are experiencing with dismax, but it is
important to note that you cannot specify a raw lucene query in the
"q" parameter of a dismax handler. If you want to search for a word
across fields, you can specify the qf (query fields) parameter.
eg.
q=commute
qf=title^10 body
(see
http://incubator.apache.org/solr/docs/api/org/apache/solr/request/DisMaxRequestHandler.html)
Turning on debugQuery=true is invaluable for determining what factors
are influencing scoring.
Was your previous solution QueryParser-based? If so, you should be
able to use the exact same queries as before, passed to
StandardRequestHAndler (assuming the fields are also set up
identically).
cheers,
-MIke
--
* --Tracey Jaquith - http://www.archive.org/~tracey
<http://www.archive.org/%7Etracey> --*