Hey,

you need to replace the query_string query with a match query, which in
turn supports the cutoff_frequency. Also make sure you change the default
operator to AND. If you want to support multiple fields, you will need to
use the multi_field query

see
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-query.html
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-multi-match-query.html

hope this helps...


--Alex


On Thu, Feb 6, 2014 at 7:58 PM, vinamar <[email protected]> wrote:

> Hi,
>
>   I have the following query given below. Currently any query term like
> "email not archived" excludes the not from the search results and
> highlighted results. i was planning to use common terms query to include
> this stop word in the results.
>
> {
>   "common": {
>     "body": {
>       "query":  "this is bonsai cool",
>       "cutoff_frequency": 0.001
>     }
>   }
> }
>
> I couldn't find any example of how to do this.
>
> Can you please let me know how should i modify my query to include this ?
>
> {
>   "timeout": 30000,
>   "highlight": {
>     "pre_tags": [
>       ""
>     ],
>     "post_tags": [
>       ""
>     ],
>     "fields": {
>       "srId": {
>         "number_of_fragments": 0
>       },
>       "emails.emailBody": {
>         "number_of_fragments": 0
>       },
>       "chatTextArray.text": {
>         "number_of_fragments": 0
>       }
>     }
>   },
>   "query": {
>     "filtered": {
>       "filter": [
>         {
>           "range": {
>             "closeDt": {
>               "from": 1325404800000,
>               "to": 1391760000000
>             }
>           }
>         }
>       ],
>       "query": {
>         "query_string": {
>           "query": "payment button",
>           "default_operator": "AND",
>           "fields": [
>             [
>               "emails.emailBody",
>               "srId",
>               "chatTextArray.text"
>             ]
>           ]
>         }
>       },
>       "_cache": true
>     }
>   },
>   "size": 10
> }
>
>
>
>
> --
> View this message in context:
> http://elasticsearch-users.115913.n3.nabble.com/common-terms-query-with-cutoff-frequency-tp4049060.html
> Sent from the ElasticSearch Users mailing list archive at Nabble.com.
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/1391713109922-4049060.post%40n3.nabble.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAGCwEM_c37QxQm7o73QKoKyxpzUWAtz_8s12czN-oArm9SF6Nw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to