Ok, so I think I have something working relatively well.  I have a few
issues which I'm not sure how to address though.  Currently when I
create my ParserPlugin in solrconfig I do the following

    <queryParser name="alias"
class="org.apache.solr.search.CustomQueryParserPlugin">
        <str name="person_name">
          person_name^1.0 person_name_first^0.5 person_name_last^0.5
       </str>
    </queryParser>

then in the CustomQueryParser I iterate over all the arguments adding
each key/value to a Map.  I then pass in this to the constructor of a
basically copied ExtendedDismaxQParser (only difference is the added
aliases and the logic to add those to the ExtendedSolrQParser).

Now, the thing I hate about this is I had to pull pieces into my own
class since some of the methods being called (in QueryUtils for
instance) are not publicly available.

Also I didn't expose parameters to allow this to be done per query
level, but I'd most certainly take suggestions on how to do this.  My
use case doesn't require it but I'd be happy to make the modifications
and try it out.

On Tue, Jul 12, 2011 at 5:08 PM, Jamie Johnson <jej2...@gmail.com> wrote:
> I'm not following where the aliasing feature I'm looking for is.
> Looking at the patch I didn't see it either.  Essentially what I'm
> looking for is when a user searches for person_name that the query
> turns into person_name:john OR person_name_first:john OR
> person_name_last:john.  I don't see anything like that here, am I just
> missing it?
>
> On Tue, Jul 12, 2011 at 3:06 PM, Chris Hostetter
> <hossman_luc...@fucit.org> wrote:
>>
>> : Thanks Hoss.  I'm not really sure where to begin looking with this, I
>> : quickly read the JIRA but don't see mention of exposing the multiple
>> : aliases.  Can you provide any more details?
>>
>> i refered to it as "uf" or "user fields" ... note the specific comment i
>> linked to in the first url, and the subsequent patch
>>
>> the colon bug in edismax is what hung me up at the time.
>>
>> :
>> : On Tue, Jul 12, 2011 at 1:19 PM, Chris Hostetter
>> : <hossman_luc...@fucit.org> wrote:
>> : > : Taking a closer look at this it seems as if the
>> : > : DisjunctionMaxQueryParser supports doing multiple aliases and
>> : > : generating multiple queries, I didn't see this same capability in the
>> : > : ExtendedDismaxQParser, am I just missing it?  If this capability were
>> : >
>> : > it's never been exposed at a user level ... i started looking at adding 
>> it
>> : > to edismax but ran into a bug i couldn't uncover in the time i had to 
>> work
>> : > on it (which i think has since been fixed)...
>> : >
>> : > 
>> https://issues.apache.org/jira/browse/SOLR-1553?focusedCommentId=12839892&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12839892
>> : > https://issues.apache.org/jira/browse/SOLR-2409
>> : > https://issues.apache.org/jira/browse/SOLR-2368
>> : >
>> : >
>> : > -Hoss
>> : >
>> :
>>
>> -Hoss
>

Reply via email to