Search not returning the intended results

Hello all,

Wondering if anyone can help me, I'm having problems in a search performed on elastic, the search itself is very simple however for some specific words, although, they exist in the intended doc, the hit is not retrieved.

this is the registry I want:

{"_index":"dre-teste","_type":"_doc","_id":"3","_score":1.0,"_source":{
"texto": "Decreto-Lei n.º 189/2008 \rde 24 de Setembro \rA legislação nacional relativa aos produtos cosméticos e de higiene corporal, ma 95/2000"

}

when i perform the search

{
  "_source": {
        "includes": [],
        "excludes": ["texto"]
    },
  "track_total_hits": true,"from": 0,"size": 100,
  "query": {
    "simple_query_string" : {
      	"query": "\"189/2008\"",
      "fields": ["texto"]
  	}   	
  },
  "highlight": {
    "fields": {
      "texto": {}
    }
  }
}

it returns the result

{
    "took": 128,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 1,
            "relation": "eq"
        },
        "max_score": 0.22584093,
        "hits": [
            {
                "_index": "dre-teste",
                "_type": "_doc",
                "_id": "3",
                "_score": 0.22584093,
                "_source": {},
                "highlight": {
                    "texto": [
                        "Decreto-Lei n.º <em>189/2008</em> \rde 24 de Setembro \rA legislação nacional relativa aos produtos cosméticos e"
                    ]
                }
            }
        ]
    }
}

However when i perform the similar search:

{
  "_source": {
        "includes": [],
        "excludes": ["texto"]
    },
  "track_total_hits": true,"from": 0,"size": 100,
  "query": {
    "simple_query_string" : {
      	"query": "\"95/2000\"",
      "fields": ["texto"]
  	}   	
  },
  "highlight": {
    "fields": {
      "texto": {}
    }
  }
}

it returns

{
    "took": 1,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 1,
            "relation": "eq"
        },
        "max_score": 1.6588712,
        "hits": [
            {
                "_index": "dre-teste",
                "_type": "_doc",
                "_id": "3",
                "_score": 1.6588712,
                "_source": {},
                "highlight": {
                    "texto": [
                        "de 24 de Setembro \rA legislação nacional relativa aos produtos cosméticos e de higiene corporal, ma <em>95</em>"
                    ]
                }
            }
        ]
    }
}

Not highlight i want only 95 not 95/2000, like in the other 189/2008 and there is an other behavior because there are more entries with 95/2000 and they don't even appear in the hits.

I very newbie on Elastic so this might be a simple fix, but i tried almost every search in the API, and constructed different analyzers but no success. IF anybody could help me, i would gratefully in debt.

Thank you all

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.