# Analayzer of multi filed, multi word, match without query string

**URL:** <https://discuss.elastic.co/t/analayzer-of-multi-filed-multi-word-match-without-query-string/23743>\
**Category:** Elasticsearch\
**Created:** [June 3, 2015, 8:56am UTC](https://discuss.elastic.co/t/analayzer-of-multi-filed-multi-word-match-without-query-string/23743 "2015-06-03T08:56:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anusha](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@Anusha](https://discuss.elastic.co/u/Anusha)\
**Post date:** [June 3, 2015, 8:56am UTC](https://discuss.elastic.co/t/analayzer-of-multi-filed-multi-word-match-without-query-string/23743/1 "2015-06-03T08:56:07Z")

</div>

Hi,

I would like to get the response including special characters in my query ,

1. I have seen using query string.. and my data sample is :

_{ "MakeCode": "2", "Year": "1987", "Model": "APOLLO/SKYLARK",  
"YearCode": "1987", "EngineCode": "3", "Engine": "4-151 2.5L",  
"ShortYear":"87", "Make": "BUICK", "ModelCode": "2"_

when I have used querystring query

GET ymme/ymmetype/\_search  
{  
"size": 50,  
"query": {  
"bool": {  
"must": [

```
       {
           "query_string": {
            
              "query": "2 and APOLLO"
           }
       }
    ]
}

```

}  
}-----\> Am getting response

_If I query as:_

```
  "query_string": {
            
              "query": "2 and APOLLO/"
           }
       }-----> throwing SearchPhaseExecutionException[Failed to 

```

execute phase [query]

1. So How can I achieve query string to accept special characters like _('/',  
'-', '(', ')', ':' ,'.')_ , is it possible with query string? if yes then  
which pattern I need I would like to know in detail..

2. Another approach also I have tried using "index\_name" to keep all my  
required field data under that 'index\_name' field inorder to search using _match,  
match\_phrase, match\_phrase\_prefix_ filters by changing my mapping as shown  
below:

_Settings and mappings:_

PUT twitter1  
{  
"settings": {

```
        "analysis": {
           "analyzer": {
              "wordAnalyzer": {
                 "type": "custom",
                 "tokenizer": "whitespace"
              }
           }
        }
     
  },
  "mappings": {
      "tweet1": {
       "properties": {
           "Engine": {
               "index_name": "name", 
              "type": "string"
           },
           "EngineCode": {
              "type": "string"
           },
           "Make": {
               "index_name": "name", 
              "type": "string"
           },
           "MakeCode": {
              "type": "string"
           },
           "Model": {
               "index_name": "name", 
              "type": "string"
           },
           "ModelCode": {
              "type": "string"
           },
           "ShortYear": {
               "index_name": "name", 
              "type": "string"
           },
           "Year": {
               "index_name": "name", 
              "type": "string"
           },
           "YearCode": {
              "type": "string"
           }
        }
     }
  }

```

}---------------\>"name": "Engine","Make","Model","ShortYear","Year"

I tried the following queries with _match, match\_phrase,  
match\_phrase\_prefix_:  
using _match_

"query": {  
"match": {  
"name": {  
"operator": "and",  
"query": "85 m"  
}  
}  
}  
This is not returning any records I tried with analyzer

GET twitter1/tweet1/\_search  
{  
"size": 20,  
"query": {  
"match": {  
"name": {  
"operator": "and",  
"query": "85 m",  
"analyzer": "wordAnalyzer"  
}  
}  
}  
}---------------\> Then all the records are returning

using _match\_phrase_:  
"query": {

```
 "match_phrase": {
    "name": "85 m"
 }

```

}-----------\> no records are returning, if name: 85 mazda ( 1 record) is  
returning

using _match\_phrase\_prefix_:  
"query": {

```
 "match_phrase": {
    "name": "85 m"
 }

```

}-----------\> returning 3 records with 85 and m combination i.e.,  
ShortYear and Make

But when I used another combination like ShortYear and Engine  
example:

"query": {

```
 "match_phrase_prefix": {
    "name": "85 v"
 }

```

}----------------\> where "Engine": "V8-302 5.0L" (0 records are  
returning)

Any good approach to solve this problem such that the request may be at any  
word any combination the relevant records need to return.  
Can any one help me out to resolve this approach.

## -- Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/191c7d96-eac9-4372-8b14-f7deba1724bd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/191c7d96-eac9-4372-8b14-f7deba1724bd%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:10am UTC](https://discuss.elastic.co/t/analayzer-of-multi-filed-multi-word-match-without-query-string/23743/2 "2017-07-06T00:10:02Z")

</div>


