Hi there,
I'd like to know if elasticsearch displays scores for document
matches. Also, how is this score calculated across indices? Is the
score local to the index?
How can I boost terms when making a query? For example: I want to
search for terms "money" and "cash" but give more importance to
"money". My query would look like "money"^10 OR "cash". How do I do
that in elasticsearch?
On Wxed, Mar 31, 2010 at 9:02 PM, didier deshommes dfdeshom@gmail.comwrote:
Hi there,
I'd like to know if elasticsearch displays scores for document
matches. Also, how is this score calculated across indices? Is the
score local to the index?
Score is calculated in a similar manner as you opening a MultiSearcher on
top of several indices in Lucene (I assume that you have Lucene knowledge
based on your questions). As you know, score itself is meaningless in Lucene
when you get it back as part of a hit (meaningless in a user sense). See
more here: http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/#Search_Type
.
How can I boost terms when making a query? For example: I want to
search for terms "money" and "cash" but give more importance to
"money". My query would look like "money"^10 OR "cash". How do I do
that in elasticsearch?
It looks like you could pass arbitrary luce queries to queryString, is
that correct? i.e. something like:
{
"queryString" : {
"query" : "+content:(this AND that OR thus^2.0) -other_field:other"
}
}
In elasticsearch sense, this is a queryString query, which simply uses
Lucene QueryParser (with extra logic on top) to parse the query string into
a query. Within the query string, you can indeed describe the query you
want. You can also build your query out of bool/term/field/rage/... queries
that you have (each mapping to the respective Lucene query). Check the query
DSL.
Does elasticsearch support raw lucene queries?
You mean your custom built ones? There is an extension point for that, if
you need it, I will explain how to implement it.
Could you elaborate more on that?
Depends. Do you want to use a custom Lucene Query that you wrote and you did
not find at the query DSL?
It looks like you could pass arbitrary luce queries to queryString, is
that correct? i.e. something like:
{
"queryString" : {
"query" : "+content:(this AND that OR thus^2.0) -other_field:other"
}
}
In elasticsearch sense, this is a queryString query, which simply uses
Lucene QueryParser (with extra logic on top) to parse the query string into
a query. Within the query string, you can indeed describe the query you
want. You can also build your query out of bool/term/field/rage/... queries
that you have (each mapping to the respective Lucene query). Check the query
DSL.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.