You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "rajkamalmn@gmail.com" <ra...@gmail.com> on 2013/08/12 18:29:26 UTC

Correct Method to write custom component code

Hi,

We are using Solr Search Engine.t
The application needs the following data:
1. Faceted output based on a field.
2. One Record for each facet.

As the application is an existing one, tweaking the application to perform 2
calls would be tedious and hence the above mentioned 2 tasks should be
performed in a single query.

Ex: For a field field1, we have values value1, value2, value3.

For Ex, the faceted count value1 - count1, value2 - count2 and value3 -
count3.

And the application needs one record with field1 as value1, field1 as value2
and field1 as value3.

As the data has tens of million of records, the records are distributed in
multiple shards.

This also can be achieved by 
q=*:*&rows=100&group=true&group.field=field1&group.limit=1&group.offset=0&fl=field1,field2,field3&qt=distributed

Where distributed request handler has all the shard set in "shards"

But Grouping of millions of records consumes time. Hence to fix the issue,
writing custom request handler had been designed as a solution.

The idea was that the new code would facet the output and get one record per
faceted field and would return the XML.
Single sharded search is simple and easy to implement, where as distributed
query involves bit complex logic.

The possible solution looked at were:
1. Implement a new component similar to Query/Facet Component, which would
perform the task for us.
2. Patch Query Component (Grouping is done by patching Query Component) to
perform the task for us. Hence Query Component would perform the needed
task, if a user given parameter is enabled, else would perform the default
Query Component code.

Has any one performed a similar task?
If so is one of the solution mentioned above correct ?
Is there a better way of handling this task ?

Thanks a lot, in advance.



--
View this message in context: http://lucene.472066.n3.nabble.com/Correct-Method-to-write-custom-component-code-tp4084031.html
Sent from the Solr - User mailing list archive at Nabble.com.