Hello Mikhail,

> I have some relevant experience and ready to help...
Thanks a lot!

> ...but I can not get the core problem. Could you please expand the
description and/or provide a
> sample?

Sure. Among other fields not relevant to this discussion, we have two
fields: a text field (Contents; searchable tokenized and filtered field)
and a unique string field document id (or doc id for short). We search on
one field (Contents), but return facets on another: (doc id). It is
absolutely legit, that Solr simply counts the number of doc ids in the
result set and since there is only one doc id per document it sets the
facet count of that doc id to 1.

What we need FacetComponent to report instead is the count of "special"
matches inside the document (one figure per document id). The "special"
matches mean, that we actually require the count of the sentences inside
each document where the hits were found. By now I know, how to retrieve the
individual sentences using Solr Highlighter: with the help
of 
hl.fragmenter=regex&hl.snippets=10000&hl.regex.pattern=[REGEX_PATTERN_TO_IDENTIFY_A_SENTENCE].

My thinking goes like this:

Implement a similar to functionality to the one of
org.apache.lucene.search.highlight.Highlighter in the FacetComponent to
perform counting of matches the way described above. Substitute per doc id
counts (1's) with the calculated sentence counts. Return the updated facet
results.

Regards,

Dmitry

On Tue, Jan 15, 2013 at 2:08 PM, Mikhail Khludnev <
mkhlud...@griddynamics.com> wrote:

> Dmitry,
>
> I have some relevant experience and ready to help, but I can not get the
> core problem. Could you please expand the description and/or provide a
> sample?
>
>
> On Tue, Jan 15, 2013 at 11:01 AM, Dmitry Kan <solrexp...@gmail.com> wrote:
>
> > Hello!
> >
> > Is there a simple way of accessing the matched token ids in the
> > FacetComponent? The use case is to text search on one field and facet on
> > another. And in the facet counts we want to see the text hit counts.
> > Can it be done via some other component / approach?
> >
> > Any input is greatly appreciated.
> >
> > Dmitry
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
>  <mkhlud...@griddynamics.com>
>

Reply via email to