Jon,

You provided a lot of nice details, thanks for helping us help you :)

The one missing piece is the definition of the "text" field type. In Solr's _example_ schema, "bobby" gets analyzed (stemmed) to "bobbi"[1]. When you query for bobby*, the query parser is not running an analyzer on the wildcard query, thus literally searching for terms that begin with "bobby"[2].

As for "steve" , same story, but it analyzes to "steve", which is found with a "steve*" query.

        Erik


[1] I used Solr's admin/analysis.jsp to double-check the "text" field type behavior.

[2] I <http://localhost:8983/solr/select/?q=bobby*&debugQuery=true> and see the parsed query in the debug output as "text:bobby*"

On Jun 23, 2008, at 4:13 PM, Jon Drukman wrote:

When I search with q=bobby I get the following record:

<doc>
   <date name="date">2008-06-23T07:06:40Z</date>
<str name="description">http://farm1.static.flickr.com/117/...</ str>
   <int name="id">9</int>
   <str name="name">Bobby Gaza</str>
   <str name="user">[EMAIL PROTECTED]</str>
</doc>

When I search with bobby* I get nothing.

When I search with steve* I get "Steve Ballmer" and "Steve Jobs"... What's going on?


The relevant part of my schema.xml is:

<fields>
<field name="id" type="integer" indexed="true" stored="true" required="true" />
  <field name="user_id" type="integer" indexed="true" stored="true" />
  <field name="name" type="text" indexed="true" stored="true"/>
  <field name="description" type="text" indexed="true" stored="true"/>
  <field name="tags" type="text" indexed="true" stored="true"/>
  <field name="user" type="text" indexed="true" stored="true"/>
  <field name="date" type="date" indexed="true" stored="true"/>
  <field name="type" type="string" indexed="true" stored="false"/>
  <field name="type_id" type="string" indexed="true" stored="false"/>
  <field name="thumb_url" type="string" indexed="true" stored="true"/>

</fields>

<!-- Field to use to determine and enforce document uniqueness.
Unless this field is marked with required="false", it will be a required field
  -->
<uniqueKey>type_id</uniqueKey>

<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>name</defaultSearchField>

Reply via email to