You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2007/12/13 07:21:43 UTC

[jira] Commented: (SOLR-405) Search additional fields when using DisMaxRequestHandler

    [ https://issues.apache.org/jira/browse/SOLR-405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551233 ] 

Hoss Man commented on SOLR-405:
-------------------------------

ditto yonik's comment.

this patch also violates the spirit of dismax, which is that user providing the "q" param shouldn't be expected to know what the field names of hte index are ... not to mention there are a probably a lot of fields you don't want the user able to "accidently" query against specificly.

If people like the idea of allowing stuff like this, a cleaner way would be to allow some dismax options for specifing a list of mapping of "field aliases" you want to advertise to your users and the real field names you want them to corrispond to (so you can tell users they can search for "author:Bob" but behind the scenes you search for author_text:Bob) then:
   1) have the dismax handler register these "aliases" on the dismax parser (it already supports aliases, the current behavior comes from the fact that the default field is aliased to list of things in the "qf")
   2) modify the partialEscape function to know about the list of aliases and don't escape any colon that appears after the name of a configured field alias.

> Search additional fields when using DisMaxRequestHandler
> --------------------------------------------------------
>
>                 Key: SOLR-405
>                 URL: https://issues.apache.org/jira/browse/SOLR-405
>             Project: Solr
>          Issue Type: Improvement
>          Components: search
>            Reporter: Doug Steigerwald
>         Attachments: dismax_additional_fields.patch
>
>
> We are heavily leaning towards using a few DisMaxRequestHandlers for searching instead of copy fields, but we ran into an issue.  Currently our sites use something like a copy field to search stories, but they also need to search additional fields (like story_source, which we don't want in the dismax).  With the DisMaxRequestHandler as it is, anything you have in the q param is searched for in the fields defined in the DisMaxRequestHandler.  We need a little more flexibility with this.
> As an example, if you search for something like "bush+AND+story_source:associated", all the fields in the dismax are searched for 'bush' and 'story_source:associated'. (The story_source field is not in the dismax handler, and we don't want it to be.)  What we want to do is search the fields defined in the dismax for 'bush', but also query the story_source field (and only the story_source field) for 'associated'.
> We came up with this small patch to let us do what we need, but wanted to throw it out there in case others were interested, or know of a better way to do this.  We're not entirely sure we did this in the right place and are hoping that  maybe someone can provide some insight on that as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.