1

I am new to Solr Facet Search. I am searching some data using Apache Solr search, I had used Facet for some column to get the count but if there is a space or special character in that field it has been taken into count separately. I had used the solution in this link Apache Solr facet search exclude space to avoid space but still my problem persists

My altered Schema.XML file after seeing the above link is

 <schema name="solr_quickstart" version="1.1">
 <types>
  <fieldType name="string" class="solr.StrField"/>
  <fieldType name="text" class="solr.TextField">
    <analyzer>
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
  </fieldType>
 <fieldType name="text_not_tokenized" class="solr.TextField">
  <analyzer>
    <tokenizer class="solr.KeywordTokenizerFactory"/>
  </analyzer>
</fieldType>
  <fieldType name="int" class="solr.TrieIntField"/>
 <fieldType name="UUIDField" class="solr.UUIDField"/>
 </types>
 <fields>
<field name="id" type="UUIDField" indexed="true"  stored="true"/>
<field name="caseid" type="int" indexed="true"  stored="true"/>
<field name="casenumber" type="text" indexed="true"  stored="true"/>
<field name="casestatus" type="text" indexed="true"  stored="true"/>
<field name="casetype" type="text" indexed="true"  stored="true"/>
<field name="closeddate" type="text" indexed="true"  stored="true"/>
<field name="courtname" type="text" indexed="true"  stored="true"/>
<field name="courtabbr" type="text" indexed="true"  stored="true"/>
<field name="fileddate" type="text" indexed="true"  stored="true"/>
<field name="judgename" type="text" indexed="true"  stored="true"/>
<field name="lastupdated" type="text" indexed="true"  stored="true"/>
<field name="maindefendant" type="text" indexed="true"  stored="true"/>
<field name="mainplaintiff" type="string" indexed="true"  stored="true"/>
<field name="all" type="string" docValues="true" indexed="true" stored="false" multiValued="true"/>


 </fields>

<defaultSearchField>casenumber</defaultSearchField>
<uniqueKey>id</uniqueKey>
<copyField source="casenumber" dest="all"/>
<copyField source="casestatus" dest="all"/>
<copyField source="casetype" dest="all"/>
<copyField source="courtname" dest="all"/>
<copyField source="courtabbr" dest="all"/>
<copyField source="judgename" dest="all"/>
<copyField source="maindefendant" dest="all"/>
<copyField source="mainplaintiff" dest="all"/>

</schema>

kindly anyone guide me in the right way of configuring my Schema.XML file

4
  • you have not used "text_not_tokenized" for the field named 'all'.. is it the same field used for faceting? Aug 4, 2015 at 12:08
  • @AbhijitBashetti Yes
    – Rajesh
    Aug 4, 2015 at 12:10
  • ok...can you try with "text_not_tokenized"...ideally there is no diff in string and this... Aug 4, 2015 at 12:12
  • @AbhijitBashetti I will try and let you know
    – Rajesh
    Aug 4, 2015 at 12:13

1 Answer 1

1

Your problem is the tokenizer.

This splits the field-value into different terms and every term get it's own count in facet queries. To avoid this, you could remove the tokenizer (ore use an other tokenizer). The result will be, that the whole field will be one term. This is a problem, if you have mar than one "subject" in your textfield.

I had an equal problem and tried to use the protected words, wich will not be applied on the tokenizer. It's more (only?) for stemming: solr not tokenizing protected words

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.