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 barrybear <ro...@gmail.com> on 2014/09/24 17:04:53 UTC

Help in selecting the appropriate feature to obtain results

Hi guys, I'm still a beginner to Solr and I'm not sure whether to implement a
custom Filter Query or any other available features/plugins that I am not
aware of in Solr. I am using Solr v4.4.0.

I have a collection as an example as below:

[
   {
      description: 'group1',
      group: ['G?', 'GE*']
   },
   {
      description: 'group2',
      group: ['GEB']
   },
   {
      description: 'group3',
      group: ['G']
   }
]

Where group field is a multiValued whereby will contain of alphabets which
will determine the ranking and  two special characters: ? and *. Placing a ?
at the back will mean any subordinate of that ranking, while * means all
levels of subordinates of that particular ranking.

If I were to search for group:'GEB', I will expect to obtain result: 
[
   {
      description: 'group1',
      group: ['G?', 'GE*']
   },
   {
      description: 'group2',
      group: ['GEB']
   }
] 

While searching for group:'GE', should return this result:
[
   {
      description: 'group1',
      group: ['G?', 'GE*']
   }
]

And finally searching for group:'G' should only return one result:
[
   {
      description: 'group3',
      group: ['G']
   }
]

Hope that my explanation is clear enough and thanks for your attention and
time..



--
View this message in context: http://lucene.472066.n3.nabble.com/Help-in-selecting-the-appropriate-feature-to-obtain-results-tp4160944.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Help in selecting the appropriate feature to obtain results

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
I call it 'reverse search' problem (regex indexing). It's almost
impossible. You can
- do it your own
http://blog.mikemccandless.com/2013/06/build-your-own-finite-state-transducer.html
- create
http://lucene.apache.org/core/4_1_0/memory/org/apache/lucene/index/memory/MemoryIndex.html
from the incoming string, and search by those stored queries with regexps.
eg check https://www.youtube.com/watch?v=rmRCsrJp2A8
- more realistically you can index separate letters from patterns, search
for any of incoming letters, and postfilter the result, which are found.


On Wed, Sep 24, 2014 at 7:04 PM, barrybear <ro...@gmail.com> wrote:

> Hi guys, I'm still a beginner to Solr and I'm not sure whether to
> implement a
> custom Filter Query or any other available features/plugins that I am not
> aware of in Solr. I am using Solr v4.4.0.
>
> I have a collection as an example as below:
>
> [
>    {
>       description: 'group1',
>       group: ['G?', 'GE*']
>    },
>    {
>       description: 'group2',
>       group: ['GEB']
>    },
>    {
>       description: 'group3',
>       group: ['G']
>    }
> ]
>
> Where group field is a multiValued whereby will contain of alphabets which
> will determine the ranking and  two special characters: ? and *. Placing a
> ?
> at the back will mean any subordinate of that ranking, while * means all
> levels of subordinates of that particular ranking.
>
> If I were to search for group:'GEB', I will expect to obtain result:
> [
>    {
>       description: 'group1',
>       group: ['G?', 'GE*']
>    },
>    {
>       description: 'group2',
>       group: ['GEB']
>    }
> ]
>
> While searching for group:'GE', should return this result:
> [
>    {
>       description: 'group1',
>       group: ['G?', 'GE*']
>    }
> ]
>
> And finally searching for group:'G' should only return one result:
> [
>    {
>       description: 'group3',
>       group: ['G']
>    }
> ]
>
> Hope that my explanation is clear enough and thanks for your attention and
> time..
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Help-in-selecting-the-appropriate-feature-to-obtain-results-tp4160944.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>