0

I have field in docs :

<str name="ss_field_condition">new</str>

When I search with full string "new" I dont see this items.

http://localhost:8983/solr/site/select?indent=on&version=2.2&q=new&fq=&start=0&rows=10&fl=*%2Cscore&wt=&debugQuery=on&explainOther=&hl.fl=

But I see many items when search with "ss_field_condition:new"

http://localhost:8983/solr/site/select?indent=on&version=2.2&q=ss_field_condition%3Anew&fq=&start=0&rows=10&fl=*%2Cscore&wt=&debugQuery=on&explainOther=&hl.fl=

As facet this field works well.

from schema.xml:

<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>

How I can enable search in this field? Version is 3.6.2. Thanks

1 Answers1

1

Seems you are using standard parser since you didn't specify defType param in your url.

And you also didn't specify which field to search on, it will use a default field configured in schema.xml. Refer: Set default search fields in Apache Solr

If you want to search on specified field(s), here is a few example:

  • search on title field:

    q="+title:new"

  • search on title field or content field, either match:

    q="title:java content:java"

  • search on title field and content field, both match:

    q="title:java +content:java"

More tips:

  • Solr is already in version 5.4.1, so try to upgrade your version if possible, there are huge changes since version 3.x, e.g solr cloud.

  • The edismax parser is more powerful to use, you might want that.

  • If you want to search on a fields, don't forget to index it, even for a string type.
Community
  • 1
  • 1
Eric
  • 22,183
  • 20
  • 145
  • 196
  • Thanks! How I can add all "string" fields automaticaly? I have big number of additional 'string' fields to include to search. – Andrey Kostromin Feb 10 '16 at 17:27
  • @AndreyKostromin refer to: http://stackoverflow.com/questions/17927992/solr-set-fileds-as-default-search-field – Eric Feb 11 '16 at 01:49