You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Paul, Lulu" <Lu...@bl.uk> on 2018/03/27 13:56:13 UTC

query regarding Solr partial search

Hi ,

Below is my SOLR configuration (schema.xml) for a keyword search field.

<field name="Keyword" type="text_general_classic" indexed="true" stored="false" multiValued="true"/>

<!-- Copy Fields BEGIN -->
<copyField source="ID" dest="Keyword"/>
<copyField source="RecordId" dest="Keyword"/>
<copyField source="ItemTypeId" dest="Keyword"/>
 <copyField source="StatusId" dest="Keyword"/>
 <copyField source="CataloguerId" dest="Keyword"/>
 <copyField source="Structure" dest="Keyword"/>
<!-- Copy Fields END-->

<fieldType name="text_general_classic" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.ClassicTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.ClassicTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.ASCIIFoldingFilterFactory" preserveOriginal="true"/>
      </analyzer>
</fieldType>


·         If I search for “Autograph full score”, Solr returns all items that contains this string in exactly the same order.

·         If I search for “full Autograph score”, Solr doesn’t return any results.

The requirement is that regardless of the order of the string, Solr should return all records which “CONTAIN” these 3 strings. Please advise how can this be made possible?

Thanks & Regards,
Lulu



******************************************************************************************************************
Experience the British Library online at www.bl.uk<http://www.bl.uk/>
The British Library’s latest Annual Report and Accounts : www.bl.uk/aboutus/annrep/index.html<http://www.bl.uk/aboutus/annrep/index.html>
Help the British Library conserve the world's knowledge. Adopt a Book. www.bl.uk/adoptabook<http://www.bl.uk/adoptabook>
The Library's St Pancras site is WiFi - enabled
*****************************************************************************************************************
The information contained in this e-mail is confidential and may be legally privileged. It is intended for the addressee(s) only. If you are not the intended recipient, please delete this e-mail and notify the postmaster@bl.uk<ma...@bl.uk> : The contents of this e-mail must not be disclosed or copied without the sender's consent.
The statements and opinions expressed in this message are those of the author and do not necessarily reflect those of the British Library. The British Library does not take any responsibility for the views of the author.
*****************************************************************************************************************
Think before you print

RE: query regarding Solr partial search

Posted by "Paul, Lulu" <Lu...@bl.uk>.
Hi Erik



Below is the configuration in our solrconfig.xml. So, yes the query parser used is edismax



  <!-- A request handler that returns indented JSON by default -->

  <requestHandler name="/query" class="solr.SearchHandler">

     <lst name="defaults">

       <str name="echoParams">explicit</str>

       <str name="wt">json</str>

       <str name="indent">true</str>

       <str name="df">text</str>

     </lst>

  </requestHandler>



  <requestHandler name="/browse" class="solr.SearchHandler">

    <lst name="defaults">

      <str name="echoParams">explicit</str>



      <!-- VelocityResponseWriter settings -->

      <str name="wt">velocity</str>

      <str name="v.template">browse</str>

      <str name="v.layout">layout</str>



      <!-- Query settings -->

      <str name="defType">edismax</str>

      <str name="q.alt">*:*</str>

      <str name="rows">10</str>

      <str name="fl">*,score</str>



      <!-- Faceting defaults -->

      <str name="facet">on</str>

      <str name="facet.mincount">1</str>

    </lst>

  </requestHandler>





Thanks & Best Regards,

Lulu Paul





-----Original Message-----
From: Erik Hatcher [mailto:erik.hatcher@gmail.com]
Sent: 27 March 2018 18:01
To: solr-user@lucene.apache.org
Subject: Re: query regarding Solr partial search



This is as much about your schema as it is about your query parser usage.   What’s parsed_query say in your debug=true output?   What query parser are you using?   If edismax, check qf/pf/mm settings, etc.



                Erik





> On Mar 27, 2018, at 9:56 AM, Paul, Lulu <Lu...@bl.uk>> wrote:

>

> Hi ,

>

> Below is my SOLR configuration (schema.xml) for a keyword search field.

>

> <field name="Keyword" type="text_general_classic" indexed="true"

> stored="false" multiValued="true"/>

>

> <!-- Copy Fields BEGIN -->

> <copyField source="ID" dest="Keyword"/> <copyField source="RecordId"

> dest="Keyword"/> <copyField source="ItemTypeId" dest="Keyword"/>

> <copyField source="StatusId" dest="Keyword"/> <copyField

> source="CataloguerId" dest="Keyword"/> <copyField source="Structure"

> dest="Keyword"/>

> <!-- Copy Fields END-->

>

> <fieldType name="text_general_classic" class="solr.TextField" positionIncrementGap="100">

>      <analyzer type="index">

>        <tokenizer class="solr.ClassicTokenizerFactory"/>

>        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />

>        <filter class="solr.LowerCaseFilterFactory"/>

>      </analyzer>

>      <analyzer type="query">

>        <tokenizer class="solr.ClassicTokenizerFactory"/>

>        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />

>        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>

>        <filter class="solr.LowerCaseFilterFactory"/>

>        <filter class="solr.ASCIIFoldingFilterFactory" preserveOriginal="true"/>

>      </analyzer>

> </fieldType>

>

>

> ·         If I search for “Autograph full score”, Solr returns all items that contains this string in exactly the same order.

>

> ·         If I search for “full Autograph score”, Solr doesn’t return any results.

>

> The requirement is that regardless of the order of the string, Solr should return all records which “CONTAIN” these 3 strings. Please advise how can this be made possible?

>

> Thanks & Regards,

> Lulu

>

>




******************************************************************************************************************
Experience the British Library online at www.bl.uk<http://www.bl.uk/>
The British Library’s latest Annual Report and Accounts : www.bl.uk/aboutus/annrep/index.html<http://www.bl.uk/aboutus/annrep/index.html>
Help the British Library conserve the world's knowledge. Adopt a Book. www.bl.uk/adoptabook<http://www.bl.uk/adoptabook>
The Library's St Pancras site is WiFi - enabled
*****************************************************************************************************************
The information contained in this e-mail is confidential and may be legally privileged. It is intended for the addressee(s) only. If you are not the intended recipient, please delete this e-mail and notify the postmaster@bl.uk<ma...@bl.uk> : The contents of this e-mail must not be disclosed or copied without the sender's consent.
The statements and opinions expressed in this message are those of the author and do not necessarily reflect those of the British Library. The British Library does not take any responsibility for the views of the author.
*****************************************************************************************************************
Think before you print

Re: query regarding Solr partial search

Posted by Erik Hatcher <er...@gmail.com>.
This is as much about your schema as it is about your query parser usage.   What’s parsed_query say in your debug=true output?   What query parser are you using?   If edismax, check qf/pf/mm settings, etc.

	Erik


> On Mar 27, 2018, at 9:56 AM, Paul, Lulu <Lu...@bl.uk> wrote:
> 
> Hi ,
> 
> Below is my SOLR configuration (schema.xml) for a keyword search field.
> 
> <field name="Keyword" type="text_general_classic" indexed="true" stored="false" multiValued="true"/>
> 
> <!-- Copy Fields BEGIN -->
> <copyField source="ID" dest="Keyword"/>
> <copyField source="RecordId" dest="Keyword"/>
> <copyField source="ItemTypeId" dest="Keyword"/>
> <copyField source="StatusId" dest="Keyword"/>
> <copyField source="CataloguerId" dest="Keyword"/>
> <copyField source="Structure" dest="Keyword"/>
> <!-- Copy Fields END-->
> 
> <fieldType name="text_general_classic" class="solr.TextField" positionIncrementGap="100">
>      <analyzer type="index">
>        <tokenizer class="solr.ClassicTokenizerFactory"/>
>        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
>        <filter class="solr.LowerCaseFilterFactory"/>
>      </analyzer>
>      <analyzer type="query">
>        <tokenizer class="solr.ClassicTokenizerFactory"/>
>        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
>        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
>        <filter class="solr.LowerCaseFilterFactory"/>
>        <filter class="solr.ASCIIFoldingFilterFactory" preserveOriginal="true"/>
>      </analyzer>
> </fieldType>
> 
> 
> ·         If I search for “Autograph full score”, Solr returns all items that contains this string in exactly the same order.
> 
> ·         If I search for “full Autograph score”, Solr doesn’t return any results.
> 
> The requirement is that regardless of the order of the string, Solr should return all records which “CONTAIN” these 3 strings. Please advise how can this be made possible?
> 
> Thanks & Regards,
> Lulu
> 
> 
> 
> ******************************************************************************************************************
> Experience the British Library online at www.bl.uk<http://www.bl.uk/>
> The British Library’s latest Annual Report and Accounts : www.bl.uk/aboutus/annrep/index.html<http://www.bl.uk/aboutus/annrep/index.html>
> Help the British Library conserve the world's knowledge. Adopt a Book. www.bl.uk/adoptabook<http://www.bl.uk/adoptabook>
> The Library's St Pancras site is WiFi - enabled
> *****************************************************************************************************************
> The information contained in this e-mail is confidential and may be legally privileged. It is intended for the addressee(s) only. If you are not the intended recipient, please delete this e-mail and notify the postmaster@bl.uk<ma...@bl.uk> : The contents of this e-mail must not be disclosed or copied without the sender's consent.
> The statements and opinions expressed in this message are those of the author and do not necessarily reflect those of the British Library. The British Library does not take any responsibility for the views of the author.
> *****************************************************************************************************************
> Think before you print