Search a specific document?

Is it possible to run a query against a specific document? I have the doc
ID and the query; I'd like to just query that document.

Thanks!

--

Actually, let me clarify: I just want the terms highlighted in the
document, if there's a match.
I could do it via JS in the client, but maybe ES is faster....

On Friday, December 7, 2012 12:59:26 PM UTC-8, A Zed wrote:

Is it possible to run a query against a specific document? I have the doc
ID and the query; I'd like to just query that document.

Thanks!

--

Have you seen highlighting option in Search API
Elasticsearch Platform — Find real-time answers at scale | Elastic ?

On Friday, December 7, 2012 4:04:18 PM UTC-5, A Zed wrote:

Actually, let me clarify: I just want the terms highlighted in the
document, if there's a match.
I could do it via JS in the client, but maybe ES is faster....

On Friday, December 7, 2012 12:59:26 PM UTC-8, A Zed wrote:

Is it possible to run a query against a specific document? I have the doc
ID and the query; I'd like to just query that document.

Thanks!

--

Yes I have. If I am able to search a specific doc, then I can use the
highlight option too.

On Friday, December 7, 2012 1:56:09 PM UTC-8, Igor Motov wrote:

Have you seen highlighting option in Search API
Elasticsearch Platform — Find real-time answers at scale | Elastic?

On Friday, December 7, 2012 4:04:18 PM UTC-5, A Zed wrote:

Actually, let me clarify: I just want the terms highlighted in the
document, if there's a match.
I could do it via JS in the client, but maybe ES is faster....

On Friday, December 7, 2012 12:59:26 PM UTC-8, A Zed wrote:

Is it possible to run a query against a specific document? I have the
doc ID and the query; I'd like to just query that document.

Thanks!

--

How about ids
filter? Elasticsearch Platform — Find real-time answers at scale | Elastic

On Friday, December 7, 2012 4:58:40 PM UTC-5, A Zed wrote:

Yes I have. If I am able to search a specific doc, then I can use the
highlight option too.

On Friday, December 7, 2012 1:56:09 PM UTC-8, Igor Motov wrote:

Have you seen highlighting option in Search API
Elasticsearch Platform — Find real-time answers at scale | Elastic?

On Friday, December 7, 2012 4:04:18 PM UTC-5, A Zed wrote:

Actually, let me clarify: I just want the terms highlighted in the
document, if there's a match.
I could do it via JS in the client, but maybe ES is faster....

On Friday, December 7, 2012 12:59:26 PM UTC-8, A Zed wrote:

Is it possible to run a query against a specific document? I have the
doc ID and the query; I'd like to just query that document.

Thanks!

--

According to what has been said in this thread to fetch only one document,
I have tested the following query trying to highlight just one document:

SearchResponse response2 = getClient().prepareSearch()
.setIndices("myindex")
.setTypes("mytype")
.setQuery(QueryBuilders
.boolQuery()
.should(QueryBuilders.matchQuery("2C", "house"))
)

  • .setFilter(FilterBuilders.idsFilter("ve0"))*
    .addHighlightedField("2C", 250, 1)
    .execute()
    .actionGet();

System.out.println("Returned " + response2.getHits().getTotalHits() + "
results");

However, the query produces zero results.

By commenting out the line

*//.setFilter(FilterBuilders.idsFilter("ve0")) *

10 results are generated as expected.

The id specified is correct. So, is it a bug or a misuse of idsFilter()?

Thanks

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/411fda5b-d0d3-41dd-9867-cfac05e49560%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I have just got my answer from fix to this bug

which contains a TestCase

where proper syntax is:

.setFilter(FilterBuilders.idsFilter("vertex").ids("ve0"))

and document is now returned.

Thanks

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/3cd7f32a-3989-45ea-ad42-96ad5307e10b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.