Java API: Requesting fields from SearchShardTarget and docId


(Jürgen kartnaller) #1

We are implementing a lot of facets for our use cases.

We have one facet which in the end provides a small list of documents.
In the final reduce step in the facet processor we want to enrich the result
by fetching additional fields for the documents in the facets.

What we have as the reference to the document is the SearchShardTarget and
the docId.

How can I fetch fields using SearchShardTarget and the docId?

Jürgen


(Shay Banon) #2

That reduce is executing on a different node probably, so you don't have
access to the other nodes there to go and fetch more data. It requires
building an API for that, and making sure it uses the same context when
going to the remote shard and fetching relevant data.

On Thu, Sep 1, 2011 at 11:05 PM, Jürgen kartnaller <
juergen.kartnaller@gmail.com> wrote:

We are implementing a lot of facets for our use cases.

We have one facet which in the end provides a small list of documents.
In the final reduce step in the facet processor we want to enrich the
result by fetching additional fields for the documents in the facets.

What we have as the reference to the document is the SearchShardTarget and
the docId.

How can I fetch fields using SearchShardTarget and the docId?

Jürgen


(Jürgen kartnaller) #3

I thought of a solution like query_then_fetch. But that code seems to be
really complex, so thats maybe the code to put in an API?

What I want to avoid is reading the document fields on each node using the
reader because then I read more data than needed which makes the facet slow.

Jürgen

On Thu, Sep 1, 2011 at 10:11 PM, Shay Banon kimchy@gmail.com wrote:

That reduce is executing on a different node probably, so you don't have
access to the other nodes there to go and fetch more data. It requires
building an API for that, and making sure it uses the same context when
going to the remote shard and fetching relevant data.

On Thu, Sep 1, 2011 at 11:05 PM, Jürgen kartnaller <
juergen.kartnaller@gmail.com> wrote:

We are implementing a lot of facets for our use cases.

We have one facet which in the end provides a small list of documents.
In the final reduce step in the facet processor we want to enrich the
result by fetching additional fields for the documents in the facets.

What we have as the reference to the document is the SearchShardTarget and
the docId.

How can I fetch fields using SearchShardTarget and the docId?

Jürgen

--
http://www.sfgdornbirn.at
http://www.mcb-bregenz.at


(system) #4