simple query

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

simple query

Gal Nitzan
Hi,

I'm new to Solr...


I'm trying to create an Auto Complete combo which is based on results from
Solr but I ran into a few problems which are related to the query.

The Schema field is:

<field name="title" type="text" indexed="true" stored="true"/>


What I try to do:
Q=title:"d*" # get all title which has the letter d followed by anything
Q=title:"do*" #get all titles that has the letters do followed by anything
Q=title:"dog*" get all titles with dog .....
Q=title:"dog%20*" ... returns
- <doc>
  <str name="title">My Dog</str>
  </doc>
- <doc>
  <str name="title">Black Dog</str>
  </doc>
- <doc>
  <str name="title">TACO DOG DIES</str>
  </doc>
- <doc>
  <str name="title">Humping Dog</str>
  </doc>
- <doc>
  <str name="title">Must Love Dogs - 2</str>
  </doc>
- <doc>
  <str name="title">Dog Dayze</str>
  </doc>

Which is greate.... BUT

When I search
Q=title:"dog%20da*"

<result name="response" numFound="0" start="0" />




Any clue to what am I missing?

TIA,

Gal Nitzan





Reply | Threaded
Open this post in threaded view
|

Re: simple query

Bertrand Delacretaz
On 4/25/07, Gal Nitzan <[hidden email]> wrote:

> ....When I search
> Q=title:"dog%20da*"
>
> <result name="response" numFound="0" start="0" />...

Probably has to do with the way your "title" field is analyzed.

The best way to debug such problems is with the analyzer admin tool:
http://localhost:8983/solr/admin/analysis.jsp - that page will show
you how your field is processed while indexing, and if a particular
query matches.

This is also briefly described in the Solr tutorial and in the xml.com
article about Solr, see http://wiki.apache.org/solr/SolrResources

-Bertrand