solrtypo3

Solr search with parentheses failed


In Solr 9.8.1 the following query does not find any results.

research_project_project_id_intS:(69772 69787 71838)

  "response":{"numFound":0,"start":0,"numFoundExact":true,"docs":[]
  }}

If I search for each item alone, all three are found.

research_project_project_id_intS:69772

  "response":{"numFound":1,"start":0,"numFoundExact":true,"docs":[
      {
        "research_project_project_id_intS":69772,

research_project_project_id_intS:69787

  "response":{"numFound":1,"start":0,"numFoundExact":true,"docs":[
      {
        "research_project_project_id_intS":69787,

research_project_project_id_intS:71838

 "response":{"numFound":1,"start":0,"numFoundExact":true,"docs":[
      {
        "research_project_project_id_intS":71838,

The field is declared as an integer

research_project_project_id_intS
Field: research_project_project_id_intS
Dynamic Field: *_intS
Type: integer

Does anyone have any idea where the error could lie?


Solution

  • We use Solr in the TYPO3 environment. The following query parser is configured:

        <str name="defType">edismax</str>  
        <str name="mm">2<-35%</str>  
    

    For this type of search to work, the following must be configured in TypoScript:

      plugin.tx_solr {  
        search {  
          query {  
            minimumMatch = 1  
          }  
        }  
      }
    

    Explanation: query.minimumMatch Sets the minimum match mm query parameter. By default the mm query parameter is set in solrconfig.xml as 2<-35%. This means that for queries with less than three words they all must match the searched fields of a document. For queries with three or more words at least 65% of them must match rounded up.

    Please consult the link to the Solr wiki for a more detailed description of the mm syntax.

    https://docs.typo3.org/p/apache-solr-for-typo3/solr/13.0/en-us/Configuration/Reference/TxSolrSearch.html#query-minimummatch