dulibrarytech / digitaldu-frontend

Digital Collections DU front end
Apache License 2.0
3 stars 0 forks source link

wildcard not working in elasticsearch #265

Closed kimpham54 closed 4 years ago

kimpham54 commented 4 years ago
{ "query":
{ "bool": 
   { "must": 
      { "bool": 
         { "should": 
            [ { "bool": 
                 { "must": 
                    [ { "nested": 
                         { "path": "display_record.identifiers",
                           "score_mode": "avg",
                           "query": 
                            { "bool": 
                               { "must": 
                                  [ { "match": 
                                       { "display_record.identifiers.identifier": { "query": "B063.04.0037.00095", "operator": "or" } } },
                                    { "match_phrase": { "display_record.identifiers.type": "local" } } ] } } } } ] } } ],
           "must": [],
           "must_not": [] } },
     "must_not": [ { "exists": { "field": "is_child_of" } } ],
     "filter": {} } }
}
        {
  "query": {
    "match": {
      "title": {
        "query": "Tucker"
      }
    }
  }
}
kimpham54 commented 4 years ago

wildcard isn't working anywhere, ideally we want wildcard to work with display_record.identifiers_identifier or partial search in that field

jrynhart commented 4 years ago

Tested again. The wildcard is working.

jrynhart commented 4 years ago

Also, wildcard on Call Number is working, but only with lowercase character. Ex. u201 will return results but not U201. I am not sure why, but converting search terms to lowercase in the search module might be a solution

jrynhart commented 4 years ago

CNR