Information on how to define search queries?

Hi

I'm a little bit confused about the very basics of a search query and I
would like to ask about some hints about it. I've been reading some basics
here:

http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/queryparsersyntax.html#Fields

And then I've been running a few queries where I don't understand the
results. So I've got an index with this data: "McDonalds" and "Mac-Donald".
The index is analyzed using this analyzer:

                "ngram":{
                    "tokenizer":"whitespace",
                    "filter":[
                        "standard",
                        "lowercase",
                        "ngram",
                        "catenate_words"
                    ]
                },

....
"ngram":{
"type":"nGram",
"min_gram":3,
"max_gram":50
},

So, I'm running three queries:

Query #1: "_search?q=field1:%22mac%20don%22&pretty=true"
Result: Mac-Donald

Query #2: "_search?q=field1:%22mc%20don%22&pretty=true"
Result: Mac-Donald, McDonald's

Query #3: "_search?q=field1?q=companyLegalName:"don%20mac"&pretty=true"
Result: None

My question is really: Is there any documentation that describes how these
queries are run? Or can someone explain it?

My initial thought was that the first query searched on "mac" OR "don" in
the field "field1" but after running these queries that thought doesn't
hold up.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

I now realise that the "mac don" query is a search on the entire string,
and what I was trying to do must be written like
"_search?q=field1:don%20field1:mac", though I'm not sure I understand the
results completely anyway. And still, is there somewhere any documentation
that covers this? Would be good to be able to reference to people that will
use the search service

On Monday, March 4, 2013 4:03:19 PM UTC+1, Per Ekman wrote:

Hi

I'm a little bit confused about the very basics of a search query and I
would like to ask about some hints about it. I've been reading some basics
here:

Apache Lucene - Query Parser Syntax

And then I've been running a few queries where I don't understand the
results. So I've got an index with this data: "McDonalds" and "Mac-Donald".
The index is analyzed using this analyzer:

                "ngram":{
                    "tokenizer":"whitespace",
                    "filter":[
                        "standard",
                        "lowercase",
                        "ngram",
                        "catenate_words"
                    ]
                },

....
"ngram":{
"type":"nGram",
"min_gram":3,
"max_gram":50
},

So, I'm running three queries:

Query #1: "_search?q=field1:%22mac%20don%22&pretty=true"
Result: Mac-Donald

Query #2: "_search?q=field1:%22mc%20don%22&pretty=true"
Result: Mac-Donald, McDonald's

Query #3: "_search?q=field1?q=companyLegalName:"don%20mac"&pretty=true"
Result: None

My question is really: Is there any documentation that describes how these
queries are run? Or can someone explain it?

My initial thought was that the first query searched on "mac" OR "don" in
the field "field1" but after running these queries that thought doesn't
hold up.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.