Digit search not working for me

Hi Team,

I am using elastic search version 0.90.5.
When I am typing single word search started working but when i type digit its not searching.
Overall for the titles which have numeric values search not showing results.
Here is the search query which i've used

curl -XPOST 'http://IP:9200/content/_search'
    {"query" : {
        "function_score" : {
          "query" : {
            "filtered" : {
              "query" : {
                "bool" : {
                  "should" : {
                    "match" : {
                      "title" : {
                        "query" : "7",
                        "type" : "phrase_prefix",
                        "analyzer" : "keyword"
                      }
                    }
                  }
                }
              }
            }
          }
          
        }
      }
    }

Even for simple analyzer also it's not working.
Can anyone please help me out

Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

My content is like:

**PUT index/content/1**
    {
      "title": "7 Aum arive"
    }

and I am querying

**POST 'http://IP:9200/content/_search'**
{"query" : {
    "function_score" : {
      "query" : {
        "filtered" : {
          "query" : {
            "bool" : {
              "should" : {
                "match" : {
                  "title" : {
                    "query" : "7",
                    "type" : "phrase_prefix",
                    "analyzer" : "keyword"
                  }
                }
              }
            }
          }
        }
      }
      
    }
  }
}

I did that in 6.2.1:

DELETE test 
PUT test/doc/1
{
  "title": "7 Aum arive"
}
POST test/_search
{
  "query": {
    "match_phrase": {
      "title": {
        "query": "7"
      }
    }
  }
}

Gives:

{
  "took": 21,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 1,
    "max_score": 0.2876821,
    "hits": [
      {
        "_index": "test",
        "_type": "doc",
        "_id": "1",
        "_score": 0.2876821,
        "_source": {
          "title": "7 Aum arive"
        }
      }
    ]
  }
}

Really time to upgrade BTW. Even 1.7 is not supported anymore.

so upgrading is the only solution?
As I am using v0.90.5, digit search doesn't work.
Please correct me if I am wrong
And also if I upgraded to v6.1 will that works with simple analyzer?

Thanks

I don't know but:

  • I'm not going to install on my laptop a so old version to test it
  • My example is much simpler than what you wrote so I'd do more practical examples

will that works with simple analyzer?

Why do you choose to use the simple analyzer instead of the default one?

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