# Newbie elasticssearch questions

**URL:** <https://discuss.elastic.co/t/newbie-elasticssearch-questions/2882>\
**Category:** Elasticsearch\
**Created:** [March 31, 2010, 6:02pm UTC](https://discuss.elastic.co/t/newbie-elasticssearch-questions/2882 "2010-03-31T18:02:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![didier\_deshommes](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@didier\_deshommes](https://discuss.elastic.co/u/didier_deshommes)\
**Post date:** [March 31, 2010, 6:02pm UTC](https://discuss.elastic.co/t/newbie-elasticssearch-questions/2882/1 "2010-03-31T18:02:54Z")

</div>

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?

Does elasticsearch support raw lucene queries?

Thanks!  
didier

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 31, 2010, 6:24pm UTC](https://discuss.elastic.co/t/newbie-elasticssearch-questions/2882/2 "2010-03-31T18:24:55Z")

</div>

On Wxed, Mar 31, 2010 at 9:02 PM, didier deshommes [dfdeshom@gmail.com](mailto:dfdeshom@gmail.com)wrote:

> 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](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?

If you know Lucene queries, then you will find the following query DSL  
familiar:  
[http://www.elasticsearch.com/docs/elasticsearch/rest\_api/query\_dsl/](http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/). This is  
the query API elasticsearch provides.

> 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.

> Thanks!  
> didier

---

<div class="post-metadata">

**Author:** ![didier\_deshommes](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@didier\_deshommes](https://discuss.elastic.co/u/didier_deshommes)\
**Post date:** [April 2, 2010, 4:11am UTC](https://discuss.elastic.co/t/newbie-elasticssearch-questions/2882/3 "2010-04-02T04:11:35Z")

</div>

On Wed, Mar 31, 2010 at 12:24 PM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> On Wxed, Mar 31, 2010 at 9:02 PM, didier deshommes [dfdeshom@gmail.com](mailto:dfdeshom@gmail.com)  
> wrote:

Hi ,thanks for replying to my questions!

> If you know Lucene queries, then you will find the following query DSL  
> familiar: [http://www.elasticsearch.com/docs/elasticsearch/rest\_api/query\_dsl/](http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/).  
> This is the query API elasticsearch provides.

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"
}

```

}

> > 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?

didier

> > Thanks!  
> > didier

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 2, 2010, 9:47am UTC](https://discuss.elastic.co/t/newbie-elasticssearch-questions/2882/4 "2010-04-02T09:47:46Z")

</div>

On Fri, Apr 2, 2010 at 7:11 AM, didier deshommes [dfdeshom@gmail.com](mailto:dfdeshom@gmail.com) wrote:

> On Wed, Mar 31, 2010 at 12:24 PM, Shay Banon  
> [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > On Wxed, Mar 31, 2010 at 9:02 PM, didier deshommes [dfdeshom@gmail.com](mailto:dfdeshom@gmail.com)  
> > wrote:
> 
> Hi ,thanks for replying to my questions!

No problem. Just so I know how to answer my questions, are you familiar with  
Lucene?

> > If you know Lucene queries, then you will find the following query DSL  
> > familiar:  
> > [http://www.elasticsearch.com/docs/elasticsearch/rest\_api/query\_dsl/](http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/).  
> > This is the query API elasticsearch provides.
> 
> 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?

> didier
> 
> > > Thanks!  
> > > didier

---

<div class="post-metadata">

**Author:** ![didier\_deshommes](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@didier\_deshommes](https://discuss.elastic.co/u/didier_deshommes)\
**Post date:** [April 3, 2010, 4:33am UTC](https://discuss.elastic.co/t/newbie-elasticssearch-questions/2882/5 "2010-04-03T04:33:27Z")

</div>

On Fri, Apr 2, 2010 at 4:47 AM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> On Fri, Apr 2, 2010 at 7:11 AM, didier deshommes [dfdeshom@gmail.com](mailto:dfdeshom@gmail.com) wrote:
> 
> > On Wed, Mar 31, 2010 at 12:24 PM, Shay Banon  
> > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> > 
> > > On Wxed, Mar 31, 2010 at 9:02 PM, didier deshommes [dfdeshom@gmail.com](mailto:dfdeshom@gmail.com)  
> > > wrote:
> > 
> > Hi ,thanks for replying to my questions!
> 
> No problem. Just so I know how to answer my questions, are you familiar with  
> Lucene?

Yes I am.

> > > If you know Lucene queries, then you will find the following query DSL
> > > 
> > > familiar: [http://www.elasticsearch.com/docs/elasticsearch/rest\_api/query\_dsl/](http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/).  
> > > This is the query API elasticsearch provides.
> > 
> > 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.

Cool, I think that answers my question 🙂

didier

---

<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, 4:24am UTC](https://discuss.elastic.co/t/newbie-elasticssearch-questions/2882/6 "2017-07-06T04:24:54Z")

</div>


