lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Including a filtered-field in the default-field
Date Mon, 12 Mar 2018 22:28:02 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Erick,

On 3/12/18 2:50 PM, Erick Erickson wrote:
> Something like:
> 
> ....solr/collection/query?q=chris shultz&defType=edismax&qf=all^10
> phonetic

Interesting. Looks like the "qf=all phonetic" would take the place of
my existing "df=all" parameter.

> The point of edismax is to take whatever the input is and
> distribute it among one or more fields defined by the "qf"
> parameter. In this case, it'll look for "chris" and "shultz" in
> both the "all" and "phonetic" fields. It would boost matches in the
> "all" field by 10, giving you an easy knob to tweak for "this field
> is more important than this other one".
> 
> You can combine  "fielded" searches, something like: 
> ....solr/collection/query?q=firstName:chris 
> shultz&defType=edismax&qf=all phonetic
> 
> would search for "shultz" in the "all" and "phonetic" fields while 
> searching for "chris" only in the "firstName" field.
> 
> As you have noticed, there are a _lot_ of knobs to tweak when it
> comes to edismax, and the result of adding &debug=query to the URL
> can be...bewildering. But edismax was created exactly to spread the
> input out across multiple fields automatically.
> 
> You can also put these as defaults in your requesthandler in 
> solrconfig.xml. The "browse" handler in some of the examples will
> give you a template, I'd copy/paste from the "browse" handler to
> you main handler (usually "selsect"), as the "browse" handler is
> tied into the Velocity templating engine....
> 
> To start, since there are a lot of parameters to tweak, I'd just
> start with the "qf" field (plus some boosts perhaps). Then move on
> to pf, pf2, pf3. mm will take a while to get your head around all
> by itself. I think once you see the basic operation, then the rest
> of the parameters will be easier to understand.
> 
> And I urge you to take it a little at a time, just use two fields
> and two terms and look at the result of &debug=query, the parsed
> query bits, 'cause each new thing you add adds a further
> complication. Fortunately you can just put different parameters on
> the URL and see the results for rapidly iterating.
> 
> Best, Erick
> 
> 
> On Mon, Mar 12, 2018 at 11:30 AM, Christopher Schultz 
> <chris@christopherschultz.net> wrote: Erick,
> 
> On 3/12/18 1:36 PM, Erick Erickson wrote:
>>>> Did you try edismax?
> 
> Err.... no, and I must admit that it's a lot to take in. Did you
> have a particular suggestion for how to use it?
> 
> Thanks, -chris
> 
>>>> On Mon, Mar 12, 2018 at 10:20 AM, Christopher Schultz 
>>>> <chris@christopherschultz.net> wrote: All,
>>>> 
>>>> I have a Solr index containing application user information 
>>>> (username, first/last, etc.). I have created an "all" field
>>>> for the purpose of using it as a default. It contains most
>>>> but not all fields.
>>>> 
>>>> I recently added phonetic searching for the first and last
>>>> names (together in a single field) but it will only work if
>>>> the query specifies that field like this:
>>>> 
>>>> chris or phonetic:schultz
>>>> 
>>>> Is there a way to add the phonetic field to the "all" field
>>>> and have it searched phonetically alongside the non-phonetic 
>>>> fields/terms? I see I cannot have multiple "default fields"
>>>> :)
>>>> 
>>>> I know on the back-end I can construct a query like this:
>>>> 
>>>> all:[query] phonetic:[query]
>>>> 
>>>> ...but I'd prefer to do as little massaging of the query as 
>>>> possible.
>>>> 
>>>> Thanks, -chris
>>>> 
> 
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlqm/vIdHGNocmlzQGNo
cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFjWfhAAumgA99yS8li4nT+r
FLtssQ4bitBaMk3QtJQCaHULV90OHYWtL2h0JDewsve+1QP1pUU0R2d/uzHdAF5G
Nzo1bqqUCkt11NwsOC4Fe7B06ZCYTlUf7r/qWiNI2fJmRy7Wit8+6qqtMuXNpGMr
U+dgsiB9Wn6ygfuDKsMU8++MIxPT908Tu2wDarTTRQ6DvGyGucuRMf8ItYKklBIv
I4pDuuS5UY8CpZcIN8bw8Hm7rbfXskC12Lezk81QDnNimbC4u8J9uinReqpWGzC0
d2VsNDkKONBzjGaeUwvtyBLJrEXqWn9F75nSq8PYC/eOalEO8iO9pwolmbtnJ3na
VRE8TjsuapoOTYZEZcxbw39/U0gCcO4Ns5Fs3W405gA5ouQ5qnOKPHnk5hRxAEBo
QW/31n+mXsjt3S8EzRtlCwyXcVykyyafS5exzzZqgx4j8hJMw3zfHUkF8oJC5nyt
f5Tvk/8w5epe/3xKSeAf+5QTtAT5/5DftYiOvMqraTxwVuO/d4QeehAMtzUVCdm8
8JXpAbvp9HiADt52fP8YqQwMs4aX3cbA8SeDaVMZK130XM72hcg7ykspwnEejE8a
DIRbHG4I5Z6F4M9mTBudKbJhhDzkWYjo5mAjnd+1apOv1wKH1qELz7XSevVsyQb0
SI+WDftPFpdJ8bAu5XTGvs5TOpw=
=RM6r
-----END PGP SIGNATURE-----

Mime
View raw message