# Problems Ranking Results With Query Containing a Period

**URL:** <https://discuss.elastic.co/t/problems-ranking-results-with-query-containing-a-period/198810>\
**Category:** Elasticsearch\
**Created:** [September 10, 2019, 1:56am UTC](https://discuss.elastic.co/t/problems-ranking-results-with-query-containing-a-period/198810 "2019-09-10T01:56:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cannon\_Moyer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cannon_moyer/32/46269_2.png) [@Cannon\_Moyer](https://discuss.elastic.co/u/Cannon_Moyer)\
**Post date:** [September 10, 2019, 1:56am UTC](https://discuss.elastic.co/t/problems-ranking-results-with-query-containing-a-period/198810/1 "2019-09-10T01:56:22Z")

</div>

I have a brand and a part number field which I have indexed using ElasticSearch 7.3.

In my mapping, I have assigned a standard analyzer to my brand field and a custom analyzer that maps `.` to "" for my `part_number` field.

I have records with a brand of "Proform" & "Healthrider" each have a part number field with the value `220769` . When I query "Proform 220769" I receive the correct results. However, when I query "Proform 22076.9" I only receive "Healthrider" results. I have increased the boost on my brand field and when I do so I only see other proform products but not the one I have stored in my index with the corresponding part number.

Here are my fields:

```auto
{:properties=>{:brand=>{:type=>"text", :analyzer=>"standard"}, :part_number=>{:type=>"text", :analyzer=>"no_dots"}}

```

And my mapping:

```auto
settings index: { 
   number_of_shards: 1
 },
analysis: {

  analyzer: {

    no_dots: {
        tokenizer: "standard",
        char_filter: [
            "replace_dots"
        ],
        filter: ["lowercase"]
    }
  },
  "char_filter": {
        "replace_dots": {
            "type": "mapping",
            "mappings": [
                ". =>"
            ]
        }
    }

}

```

And my query:

```
{
   query:{
       
       multi_match:{
            fields: ["part_number", "brand"],
            query: "#{query}"
       }
                
   },highlight: {
        fields: {
           :"*" => {}
        }
   }
      
}
```

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [September 13, 2019, 3:35pm UTC](https://discuss.elastic.co/t/problems-ranking-results-with-query-containing-a-period/198810/2 "2019-09-13T15:35:40Z")

</div>

Just tried here with 7.2 and couldn't reproduce. All these queries work for me:

```
DELETE test
PUT test
{
  "settings": {
	"number_of_shards": 1,
	"analysis": {
	  "analyzer": {
		"no_dots": {
		  "tokenizer": "standard",
		  "char_filter": [
			"replace_dots"
		  ],
		  "filter": [
			"lowercase"
		  ]
		}
	  },
	  "char_filter": {
		"replace_dots": {
		  "type": "mapping",
		  "mappings": [
			". =>"
		  ]
		}
	  }
	}
  },
  "mappings": {
	"properties": {
	  "text": {
		"type": "text",
		"analyzer": "no_dots"
	  },
	  "brand": {
		"type": "text",
		"analyzer": "standard"
	  }
	}
  }
}
POST test/_analyze
{
  "analyzer": "no_dots",
  "text": "22076.9"
}
POST test/_doc
{
  "text":"22076.9",
  "brand":"Proform"
}
GET test/_search
{
   "query":{
   
	   "multi_match":{
			"fields": ["text", "brand"],
			"query": "Proform 22076.9"
	   }
   }
}
GET test/_search
{
   "query":{
   
	   "multi_match":{
			"fields": ["text", "brand"],
			"query": "Proform 220769"
	   }
   }
}
GET test/_search
{
   "query":{
   
	   "multi_match":{
			"fields": ["text", "brand"],
			"query": "220769"
	   }
   }
}
GET test/_search
{
   "query":{
   
	   "multi_match":{
			"fields": ["text", "brand"],
			"query": " 22076.9"
	   }
   }
}
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 11, 2019, 3:35pm UTC](https://discuss.elastic.co/t/problems-ranking-results-with-query-containing-a-period/198810/3 "2019-10-11T15:35:43Z")

</div>

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