Hi Pratik,

in Lucene query syntax, which is what query_string uses, supports
boosting of terms with ^N notation (0), so

"Arvind^6 Kejriwal^6 India Today economic times"

will mark the two first terms as more important.

0 - 
http://lucene.apache.org/core/2_9_4/queryparsersyntax.html#Boosting%20a%20Term

Hope this helps,
Honza

On Tue, Mar 18, 2014 at 11:25 AM, Pratik Poddar <[email protected]> wrote:
>
> Hey,
>
> Sorry for the noob question. Realy appreciate if someone can help me through
> this. I am using Elastic Search python. I am search a string like "Arvind
> Kejriwal India Today Economic Times" and it gives me reasonable results. I
> was hoping I could increase weight of the first words more in the search
> query. How can I do that?
>
> res = es.search(index="article-index", fields="url", body={"query":
> {"query_string": {"query": keywordstr, "fields": ["text", "title", "tags",
> "domain"]}}})
>
> I am using the above command to search right now.
>
> http://stackoverflow.com/questions/22476315/elastic-search-boost-query-corresponding-to-first-search-term
>
> --
> 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/8cecfda7-ab8b-4d0a-9a30-babd869b39c4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/CABfdDir0XEpCtL3Yt1k7x2U9JG-PHS7H4k6JiuGSdUkR_2D8tg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to