Searching a object and using fields in

Hello,

I have indexed documents like this:

{
"title": "Some title text here",
"description": "some more text here",
"object": {
"c52a85d39125e6b4cdeaafb87c1ef565":"Text to be searched",
"faf709ec2943202db7300bcc7eeb2930": "more text here"
}
}

When searching I would like to use the boost functionality. So queries look
like this:

{
"query": {
"query_string": {
"fields":["title^3", "description^2", "object"],
"query":"terms here"
}
}
}

When running the example above the search is only performed in the fields
"title" and "description". Is there any way to enable searching through all
fields in the "object" like "object.*"?

Best regards,
Bernd

View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1877605p1877605.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

No, there isn't currently, but can be implemented....

On Wed, Nov 10, 2010 at 7:55 PM, bernd iberndlu@googlemail.com wrote:

Hello,

I have indexed documents like this:

{
"title": "Some title text here",
"description": "some more text here",
"object": {
"c52a85d39125e6b4cdeaafb87c1ef565":"Text to be searched",
"faf709ec2943202db7300bcc7eeb2930": "more text here"
}
}

When searching I would like to use the boost functionality. So queries look
like this:

{
"query": {
"query_string": {
"fields":["title^3", "description^2", "object"],
"query":"terms here"
}
}
}

When running the example above the search is only performed in the fields
"title" and "description". Is there any way to enable searching through all
fields in the "object" like "object.*"?

Best regards,
Bernd

View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1877605p1877605.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

i.e. open a feature request for that :slight_smile:

On Sat, Nov 13, 2010 at 12:41 AM, Shay Banon
shay.banon@elasticsearch.comwrote:

No, there isn't currently, but can be implemented....

On Wed, Nov 10, 2010 at 7:55 PM, bernd iberndlu@googlemail.com wrote:

Hello,

I have indexed documents like this:

{
"title": "Some title text here",
"description": "some more text here",
"object": {
"c52a85d39125e6b4cdeaafb87c1ef565":"Text to be searched",
"faf709ec2943202db7300bcc7eeb2930": "more text here"
}
}

When searching I would like to use the boost functionality. So queries
look
like this:

{
"query": {
"query_string": {
"fields":["title^3", "description^2", "object"],
"query":"terms here"
}
}
}

When running the example above the search is only performed in the fields
"title" and "description". Is there any way to enable searching through
all
fields in the "object" like "object.*"?

Best regards,
Bernd

View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1877605p1877605.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

Hi,

what I think you can try doing in the meantime is exclude title and
description from _all field and update your query by adding a boolean query.
Something like:

{ query : {
bool : {
should : {
[
{ query_string : { fields : [title^3, description^2], query: "blah
blah"}},
{ query_string : { query : "blah blah"}}
],
minimum_number_should_match : 1
}
}
}
}

(did not try to run this query so the syntax may not be correct, but hope
the idea is clear)

Regards,
Lukas

On Wed, Nov 10, 2010 at 6:55 PM, bernd iberndlu@googlemail.com wrote:

Hello,

I have indexed documents like this:

{
"title": "Some title text here",
"description": "some more text here",
"object": {
"c52a85d39125e6b4cdeaafb87c1ef565":"Text to be searched",
"faf709ec2943202db7300bcc7eeb2930": "more text here"
}
}

When searching I would like to use the boost functionality. So queries look
like this:

{
"query": {
"query_string": {
"fields":["title^3", "description^2", "object"],
"query":"terms here"
}
}
}

When running the example above the search is only performed in the fields
"title" and "description". Is there any way to enable searching through all
fields in the "object" like "object.*"?

Best regards,
Bernd

View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1877605p1877605.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

Hi,

thank you all for the answers. I've added a feature request and will try the query of Lukas meanwhile.

Regards,
Bernd

Am 13.11.2010 um 00:09 schrieb Lukáš Vlček [via Elasticsearch Users]:

Hi,

what I think you can try doing in the meantime is exclude title and description from _all field and update your query by adding a boolean query. Something like:

{ query : {
bool : {
should : {
[
{ query_string : { fields : [title^3, description^2], query: "blah blah"}},
{ query_string : { query : "blah blah"}}
],
minimum_number_should_match : 1
}
}
}
}

(did not try to run this query so the syntax may not be correct, but hope the idea is clear)

Regards,
Lukas

On Wed, Nov 10, 2010 at 6:55 PM, bernd <[hidden email]> wrote:

Hello,

I have indexed documents like this:

{
"title": "Some title text here",
"description": "some more text here",
"object": {
"c52a85d39125e6b4cdeaafb87c1ef565":"Text to be searched",
"faf709ec2943202db7300bcc7eeb2930": "more text here"
}
}

When searching I would like to use the boost functionality. So queries look
like this:

{
"query": {
"query_string": {
"fields":["title^3", "description^2", "object"],
"query":"terms here"
}
}
}

When running the example above the search is only performed in the fields
"title" and "description". Is there any way to enable searching through all
fields in the "object" like "object.*"?

Best regards,
Bernd

View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1877605p1877605.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

View message @ http://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1891865p1892056.html
To start a new topic under Elasticsearch Users, email ml-node+115913-1162261748-260102@n3.nabble.com
To unsubscribe from Elasticsearch Users, click here.

Pushed to master:
Query DSL: Allow to provide pattern field names when using query_string query · Issue #511 · elastic/elasticsearch · GitHub.

On Sat, Nov 13, 2010 at 1:16 AM, bernd iberndlu@googlemail.com wrote:

Hi,

thank you all for the answers. I've added a feature request and will try
the query of Lukas meanwhile.

Regards,
Bernd

Am 13.11.2010 um 00:09 schrieb Lukáš Vlček [via Elasticsearch Users]:

Hi,

what I think you can try doing in the meantime is exclude title and
description from _all field and update your query by adding a boolean query.
Something like:

{ query : {
bool : {
should : {
[
{ query_string : { fields : [title^3, description^2], query:
"blah blah"}},
{ query_string : { query : "blah blah"}}
],
minimum_number_should_match : 1
}
}
}
}

(did not try to run this query so the syntax may not be correct, but hope
the idea is clear)

Regards,
Lukas

On Wed, Nov 10, 2010 at 6:55 PM, bernd <[hidden email]<#12c4260843f7b033_>

wrote:

Hello,

I have indexed documents like this:

{
"title": "Some title text here",
"description": "some more text here",
"object": {
"c52a85d39125e6b4cdeaafb87c1ef565":"Text to be searched",
"faf709ec2943202db7300bcc7eeb2930": "more text here"
}
}

When searching I would like to use the boost functionality. So queries
look
like this:

{
"query": {
"query_string": {
"fields":["title^3", "description^2", "object"],
"query":"terms here"
}
}
}

When running the example above the search is only performed in the fields
"title" and "description". Is there any way to enable searching through
all
fields in the "object" like "object.*"?

Best regards,
Bernd

View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1877605p1877605.htmlhttp://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1877605p1877605.html?by-user=t&by-user=t
Sent from the Elasticsearch Users mailing list archive at Nabble.comhttp://Nabble.com?by-user=t
.


View message @
http://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1891865p1892056.htmlhttp://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1891865p1892056.html?by-user=t
To start a new topic under Elasticsearch Users, email [hidden email]http://user/SendEmail.jtp?type=node&node=1892089&i=0
To unsubscribe from Elasticsearch Users, click herehttp://elasticsearch-users.115913.n3.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=115913&code=aWJlcm5kbHVAZ29vZ2xlbWFpbC5jb218MTE1OTEzfC03NTUxMTIwMzQ=&by-user=t.


View this message in context: Re: Searching a object and using fields inhttp://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1891865p1892089.html

Sent from the Elasticsearch Users mailing list archivehttp://elasticsearch-users.115913.n3.nabble.com/at Nabble.com.

Oh crap! You are so fast... now I will never learn whether my idea which I
proposed to Bernd ever worked or not... :slight_smile:

On Sat, Nov 13, 2010 at 1:26 AM, Shay Banon shay.banon@elasticsearch.comwrote:

Pushed to master:
Query DSL: Allow to provide pattern field names when using query_string query · Issue #511 · elastic/elasticsearch · GitHub.

On Sat, Nov 13, 2010 at 1:16 AM, bernd iberndlu@googlemail.com wrote:

Hi,

thank you all for the answers. I've added a feature request and will try
the query of Lukas meanwhile.

Regards,
Bernd

Am 13.11.2010 um 00:09 schrieb Lukáš Vlček [via Elasticsearch Users]:

Hi,

what I think you can try doing in the meantime is exclude title and
description from _all field and update your query by adding a boolean query.
Something like:

{ query : {
bool : {
should : {
[
{ query_string : { fields : [title^3, description^2], query:
"blah blah"}},
{ query_string : { query : "blah blah"}}
],
minimum_number_should_match : 1
}
}
}
}

(did not try to run this query so the syntax may not be correct, but hope
the idea is clear)

Regards,
Lukas

On Wed, Nov 10, 2010 at 6:55 PM, bernd <[hidden email]<#12c42a0cf9f4d625_12c4260843f7b033_>

wrote:

Hello,

I have indexed documents like this:

{
"title": "Some title text here",
"description": "some more text here",
"object": {
"c52a85d39125e6b4cdeaafb87c1ef565":"Text to be searched",
"faf709ec2943202db7300bcc7eeb2930": "more text here"
}
}

When searching I would like to use the boost functionality. So queries
look
like this:

{
"query": {
"query_string": {
"fields":["title^3", "description^2", "object"],
"query":"terms here"
}
}
}

When running the example above the search is only performed in the fields
"title" and "description". Is there any way to enable searching through
all
fields in the "object" like "object.*"?

Best regards,
Bernd

View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1877605p1877605.htmlhttp://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1877605p1877605.html?by-user=t&by-user=t
Sent from the Elasticsearch Users mailing list archive at Nabble.comhttp://Nabble.com?by-user=t
.


View message @
http://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1891865p1892056.htmlhttp://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1891865p1892056.html?by-user=t
To start a new topic under Elasticsearch Users, email [hidden email]http://user/SendEmail.jtp?type=node&node=1892089&i=0
To unsubscribe from Elasticsearch Users, click herehttp://elasticsearch-users.115913.n3.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=115913&code=aWJlcm5kbHVAZ29vZ2xlbWFpbC5jb218MTE1OTEzfC03NTUxMTIwMzQ=&by-user=t.


View this message in context: Re: Searching a object and using fields inhttp://elasticsearch-users.115913.n3.nabble.com/Searching-a-object-and-using-fields-in-tp1891865p1892089.html

Sent from the Elasticsearch Users mailing list archivehttp://elasticsearch-users.115913.n3.nabble.com/at Nabble.com.