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 Bing Hua <bh...@cornell.edu> on 2012/08/07 22:56:30 UTC

Does Solr support 'Value Search'?

Hi folks,

Just wondering if there is a query handler that simply takes a query string
and search on all/part of fields for field values?

e.g. 
q=*admin*

Response may look like
author: [admin, system_admin, sub_admin]
last_modifier: [admin, system_admin, sub_admin]
doctitle: [AdminGuide, AdminManual]



--
View this message in context: http://lucene.472066.n3.nabble.com/Does-Solr-support-Value-Search-tp3999654.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Does Solr support 'Value Search'?

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Sure, Lucene is kind of column oriented DB. if the same text occurs in two
different fields there is no any relation between such terms i.e. BRAND:RED
vs COLOR:RED. The only thing I can suggest you is build separate index (in
solr core) with docs like token:RED; fields:{COLOR, BRAND,,} or giving your
initial sample:
{token:admin; field:author; original_text:system_admin}
{token:admin; field:author; original_text:admin}
{token:admin; field:doctitle; original_text:AdminGuide}
...
then you can search by token:admin and find such occurrence documents.

On Thu, Aug 9, 2012 at 10:50 PM, Bing Hua <bh...@cornell.edu> wrote:

> Thanks Kuli and Mikhail,
>
> Using either termcomponent or suggester I could get some suggested terms
> but
> it's still confusing me how to get the respective field names. In order to
> get that, Use TermComponent I'll need to do a term query to every possible
> field. Similar things as using SpellCheckComponent. CopyField won't help
> since I want the original field name.
>
> Any suggestions?
> Bing
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Does-Solr-support-Value-Search-tp3999654p4000267.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Sincerely yours
Mikhail Khludnev
Tech Lead
Grid Dynamics

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

Re: Does Solr support 'Value Search'?

Posted by Bing Hua <bh...@cornell.edu>.
Thanks Kuli and Mikhail,

Using either termcomponent or suggester I could get some suggested terms but
it's still confusing me how to get the respective field names. In order to
get that, Use TermComponent I'll need to do a term query to every possible
field. Similar things as using SpellCheckComponent. CopyField won't help
since I want the original field name.

Any suggestions?
Bing 



--
View this message in context: http://lucene.472066.n3.nabble.com/Does-Solr-support-Value-Search-tp3999654p4000267.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Does Solr support 'Value Search'?

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Ok. this explanation is much cleaner. Have you tried to invoke
http://wiki.apache.org/solr/TermsComponent/ against all fields which you
need?

On Wed, Aug 8, 2012 at 10:56 PM, Bing Hua <bh...@cornell.edu> wrote:

> Not quite understand but I'd explain the problem I had. The response would
> contain only fields and a list of field values that match the query.
> Essentially it's querying for field values rather than documents. The
> underlying use case would be, when typing in a quick search box, the drill
> down menu may contain matches on authors, on doctitles, and potentially on
> other fields.
>
> Still thanks for your response and hopefully I'm making it clearer.
> Bing
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Does-Solr-support-Value-Search-tp3999654p3999927.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Sincerely yours
Mikhail Khludnev
Tech Lead
Grid Dynamics

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

Re: Does Solr support 'Value Search'?

Posted by Michael Kuhlmann <ku...@solarier.de>.
On 08.08.2012 20:56, Bing Hua wrote:
> Not quite understand but I'd explain the problem I had. The response would
> contain only fields and a list of field values that match the query.
> Essentially it's querying for field values rather than documents. The
> underlying use case would be, when typing in a quick search box, the drill
> down menu may contain matches on authors, on doctitles, and potentially on
> other fields.
>
> Still thanks for your response and hopefully I'm making it clearer.
> Bing

Hi Bing,

hmh, I implemented myself an autosuggest component that does exactly 
this. You could specify which field you wanted to query, give an 
optional weight to them, and the component returned a list of all fields 
and values beginning with the queried string. Either combined or per 
field, depending on your configuration.

However, that was with Solr 1.4.0, when there was no genuine suggest 
component available. Since then, the Suggester component has been 
implemented: http://wiki.apache.org/solr/Suggester/

This relies on the spell check dictionary and works better than a simple 
term dictionary approach. And that's the reason why I didn't bother my 
old code any more.

So maybe you're simply looking for the suggester component? If not, I 
can try to make my old-style component work with a current Solr version 
and spread it around. Just tell me.

Greetings,
Kuli

Re: Does Solr support 'Value Search'?

Posted by Bing Hua <bh...@cornell.edu>.
Not quite understand but I'd explain the problem I had. The response would
contain only fields and a list of field values that match the query.
Essentially it's querying for field values rather than documents. The
underlying use case would be, when typing in a quick search box, the drill
down menu may contain matches on authors, on doctitles, and potentially on
other fields.

Still thanks for your response and hopefully I'm making it clearer.
Bing



--
View this message in context: http://lucene.472066.n3.nabble.com/Does-Solr-support-Value-Search-tp3999654p3999927.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Does Solr support 'Value Search'?

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Ok. It seems to me you can configure
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.WordDelimiterFilterFactoryfor
index-time to produce "admin" term from all your docs above, after
that
you'll be able to match by simple term query.
Is it what are you looking for?

On Wed, Aug 8, 2012 at 6:43 PM, Bing Hua <bh...@cornell.edu> wrote:

> Thanks for the response but wait... Is it related to my question searching
> for field values? I was not asking how to use wildcards though.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Does-Solr-support-Value-Search-tp3999654p3999817.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Sincerely yours
Mikhail Khludnev
Tech Lead
Grid Dynamics

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

Re: Does Solr support 'Value Search'?

Posted by Bing Hua <bh...@cornell.edu>.
Thanks for the response but wait... Is it related to my question searching
for field values? I was not asking how to use wildcards though. 



--
View this message in context: http://lucene.472066.n3.nabble.com/Does-Solr-support-Value-Search-tp3999654p3999817.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Does Solr support 'Value Search'?

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Hello,

Have you checked
http://lucidworks.lucidimagination.com/display/lweug/Wildcard+Queries ?

On Wed, Aug 8, 2012 at 12:56 AM, Bing Hua <bh...@cornell.edu> wrote:

> Hi folks,
>
> Just wondering if there is a query handler that simply takes a query string
> and search on all/part of fields for field values?
>
> e.g.
> q=*admin*
>
> Response may look like
> author: [admin, system_admin, sub_admin]
> last_modifier: [admin, system_admin, sub_admin]
> doctitle: [AdminGuide, AdminManual]
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Does-Solr-support-Value-Search-tp3999654.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Sincerely yours
Mikhail Khludnev
Tech Lead
Grid Dynamics

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