Re: Multiple "df" fields
Goodness me, woops, yes, it was a typo -- sorry fo the confusion. We're indeed exploring qf, rather than pf! :). So far it's looking promising! Thanks for your eagle-eye spotting! Best, Edd Edward Turner On Wed, 12 Aug 2020 at 13:15, Erick Erickson wrote: > Probably a typo but I think you mean qf rather than pf? > > They’re both actually valid, but pf is “phrase field” which will give > different results…. > > Best, > Erick > > > On Aug 12, 2020, at 5:26 AM, Edward Turner wrote: > > > > Many thanks for your suggestions. > > > > We do use edismax and bq fields to help with our result ranking, but we'd > > never thought about using it for this purpose (we were stuck on the > > copyfield pattern + df pattern). This is a good suggestion though thank > you. > > > > We're now exploring the use of the pf field (thanks to Alexandre R. for > > this) to automatically search on multiple fields, rather than relying on > df. > > > > Kind regards, > > > > Edd > > > > Edward Turner > > > > > > On Tue, 11 Aug 2020 at 15:44, Erick Erickson > > wrote: > > > >> Have you explored edismax? > >> > >>> On Aug 11, 2020, at 10:34 AM, Alexandre Rafalovitch < > arafa...@gmail.com> > >> wrote: > >>> > >>> I can't remember if field aliasing works with df but it may be worth a > >> try: > >>> > >>> > >> > https://lucene.apache.org/solr/guide/8_1/the-extended-dismax-query-parser.html#field-aliasing-using-per-field-qf-overrides > >>> > >>> Another example: > >>> > >> > https://github.com/arafalov/solr-indexing-book/blob/master/published/languages/conf/solrconfig.xml > >>> > >>> Regards, > >>> Alex > >>> > >>> On Tue., Aug. 11, 2020, 9:59 a.m. Edward Turner, > >>> wrote: > >>> > Hi all, > > Is it possible to have multiple "df" fields? (We think the answer is > no > because our experiments did not work when adding multiple "df" values > to > solrconfig.xml -- but we just wanted to double check with those who > know > better.) The reason we would like to do this is that we have two main > >> field > types (with different analyzers) and we'd like queries without a field > >> to > be searched over both of them. We could also use copyfields, but this > >> would > require us to have a common analyzer, which isn't exactly what we > want. > > An alternative solution is to pre-process the query prior to sending > it > >> to > Solr, so that queries with no field are changed as follows: > > q=value -> q=(field1:value OR field2:value) > > ... however, we feel a bit uncomfortable doing this though via String > manipulation. > > Is there an obvious way we should tackle this problem that we are > >> missing > (e.g., which would be cleaner/safer and perhaps works at the Query > >> object > level)? > > Many thanks and best wishes, > > Edd > > >> > >> > >
Re: Multiple "df" fields
Probably a typo but I think you mean qf rather than pf? They’re both actually valid, but pf is “phrase field” which will give different results…. Best, Erick > On Aug 12, 2020, at 5:26 AM, Edward Turner wrote: > > Many thanks for your suggestions. > > We do use edismax and bq fields to help with our result ranking, but we'd > never thought about using it for this purpose (we were stuck on the > copyfield pattern + df pattern). This is a good suggestion though thank you. > > We're now exploring the use of the pf field (thanks to Alexandre R. for > this) to automatically search on multiple fields, rather than relying on df. > > Kind regards, > > Edd > > Edward Turner > > > On Tue, 11 Aug 2020 at 15:44, Erick Erickson > wrote: > >> Have you explored edismax? >> >>> On Aug 11, 2020, at 10:34 AM, Alexandre Rafalovitch >> wrote: >>> >>> I can't remember if field aliasing works with df but it may be worth a >> try: >>> >>> >> https://lucene.apache.org/solr/guide/8_1/the-extended-dismax-query-parser.html#field-aliasing-using-per-field-qf-overrides >>> >>> Another example: >>> >> https://github.com/arafalov/solr-indexing-book/blob/master/published/languages/conf/solrconfig.xml >>> >>> Regards, >>> Alex >>> >>> On Tue., Aug. 11, 2020, 9:59 a.m. Edward Turner, >>> wrote: >>> Hi all, Is it possible to have multiple "df" fields? (We think the answer is no because our experiments did not work when adding multiple "df" values to solrconfig.xml -- but we just wanted to double check with those who know better.) The reason we would like to do this is that we have two main >> field types (with different analyzers) and we'd like queries without a field >> to be searched over both of them. We could also use copyfields, but this >> would require us to have a common analyzer, which isn't exactly what we want. An alternative solution is to pre-process the query prior to sending it >> to Solr, so that queries with no field are changed as follows: q=value -> q=(field1:value OR field2:value) ... however, we feel a bit uncomfortable doing this though via String manipulation. Is there an obvious way we should tackle this problem that we are >> missing (e.g., which would be cleaner/safer and perhaps works at the Query >> object level)? Many thanks and best wishes, Edd >> >>
Re: Multiple "df" fields
Many thanks for your suggestions. We do use edismax and bq fields to help with our result ranking, but we'd never thought about using it for this purpose (we were stuck on the copyfield pattern + df pattern). This is a good suggestion though thank you. We're now exploring the use of the pf field (thanks to Alexandre R. for this) to automatically search on multiple fields, rather than relying on df. Kind regards, Edd Edward Turner On Tue, 11 Aug 2020 at 15:44, Erick Erickson wrote: > Have you explored edismax? > > > On Aug 11, 2020, at 10:34 AM, Alexandre Rafalovitch > wrote: > > > > I can't remember if field aliasing works with df but it may be worth a > try: > > > > > https://lucene.apache.org/solr/guide/8_1/the-extended-dismax-query-parser.html#field-aliasing-using-per-field-qf-overrides > > > > Another example: > > > https://github.com/arafalov/solr-indexing-book/blob/master/published/languages/conf/solrconfig.xml > > > > Regards, > >Alex > > > > On Tue., Aug. 11, 2020, 9:59 a.m. Edward Turner, > > wrote: > > > >> Hi all, > >> > >> Is it possible to have multiple "df" fields? (We think the answer is no > >> because our experiments did not work when adding multiple "df" values to > >> solrconfig.xml -- but we just wanted to double check with those who know > >> better.) The reason we would like to do this is that we have two main > field > >> types (with different analyzers) and we'd like queries without a field > to > >> be searched over both of them. We could also use copyfields, but this > would > >> require us to have a common analyzer, which isn't exactly what we want. > >> > >> An alternative solution is to pre-process the query prior to sending it > to > >> Solr, so that queries with no field are changed as follows: > >> > >> q=value -> q=(field1:value OR field2:value) > >> > >> ... however, we feel a bit uncomfortable doing this though via String > >> manipulation. > >> > >> Is there an obvious way we should tackle this problem that we are > missing > >> (e.g., which would be cleaner/safer and perhaps works at the Query > object > >> level)? > >> > >> Many thanks and best wishes, > >> > >> Edd > >> > >
Re: Multiple "df" fields
Have you explored edismax? > On Aug 11, 2020, at 10:34 AM, Alexandre Rafalovitch > wrote: > > I can't remember if field aliasing works with df but it may be worth a try: > > https://lucene.apache.org/solr/guide/8_1/the-extended-dismax-query-parser.html#field-aliasing-using-per-field-qf-overrides > > Another example: > https://github.com/arafalov/solr-indexing-book/blob/master/published/languages/conf/solrconfig.xml > > Regards, >Alex > > On Tue., Aug. 11, 2020, 9:59 a.m. Edward Turner, > wrote: > >> Hi all, >> >> Is it possible to have multiple "df" fields? (We think the answer is no >> because our experiments did not work when adding multiple "df" values to >> solrconfig.xml -- but we just wanted to double check with those who know >> better.) The reason we would like to do this is that we have two main field >> types (with different analyzers) and we'd like queries without a field to >> be searched over both of them. We could also use copyfields, but this would >> require us to have a common analyzer, which isn't exactly what we want. >> >> An alternative solution is to pre-process the query prior to sending it to >> Solr, so that queries with no field are changed as follows: >> >> q=value -> q=(field1:value OR field2:value) >> >> ... however, we feel a bit uncomfortable doing this though via String >> manipulation. >> >> Is there an obvious way we should tackle this problem that we are missing >> (e.g., which would be cleaner/safer and perhaps works at the Query object >> level)? >> >> Many thanks and best wishes, >> >> Edd >>
Re: Multiple "df" fields
I can't remember if field aliasing works with df but it may be worth a try: https://lucene.apache.org/solr/guide/8_1/the-extended-dismax-query-parser.html#field-aliasing-using-per-field-qf-overrides Another example: https://github.com/arafalov/solr-indexing-book/blob/master/published/languages/conf/solrconfig.xml Regards, Alex On Tue., Aug. 11, 2020, 9:59 a.m. Edward Turner, wrote: > Hi all, > > Is it possible to have multiple "df" fields? (We think the answer is no > because our experiments did not work when adding multiple "df" values to > solrconfig.xml -- but we just wanted to double check with those who know > better.) The reason we would like to do this is that we have two main field > types (with different analyzers) and we'd like queries without a field to > be searched over both of them. We could also use copyfields, but this would > require us to have a common analyzer, which isn't exactly what we want. > > An alternative solution is to pre-process the query prior to sending it to > Solr, so that queries with no field are changed as follows: > > q=value -> q=(field1:value OR field2:value) > > ... however, we feel a bit uncomfortable doing this though via String > manipulation. > > Is there an obvious way we should tackle this problem that we are missing > (e.g., which would be cleaner/safer and perhaps works at the Query object > level)? > > Many thanks and best wishes, > > Edd >
Re: Multiple "df" fields
Hi David, We tried using copyfields, and we can get this to work, but it's not exactly what we want because we need to use a common type. E.g., Then if our "df" is specified as the "content" field, we can search over "id", "name" and "organism" in one swoop. However, "content" has a different type to "id" and "name", and so our search results might be different than if we had searched directly on "id" or "name". e.g., q=id:value1 // hits id field, which uses the "simple" type q=value1 // hits content field, which uses the "complex" type ... so results might differ between the two queries I hope this clarifies our question? Best, Edd Edward Turner On Tue, 11 Aug 2020 at 15:03, David Hastings wrote: > why not use a copyfield for indexing? > > On Tue, Aug 11, 2020 at 9:59 AM Edward Turner wrote: > > > Hi all, > > > > Is it possible to have multiple "df" fields? (We think the answer is no > > because our experiments did not work when adding multiple "df" values to > > solrconfig.xml -- but we just wanted to double check with those who know > > better.) The reason we would like to do this is that we have two main > field > > types (with different analyzers) and we'd like queries without a field to > > be searched over both of them. We could also use copyfields, but this > would > > require us to have a common analyzer, which isn't exactly what we want. > > > > An alternative solution is to pre-process the query prior to sending it > to > > Solr, so that queries with no field are changed as follows: > > > > q=value -> q=(field1:value OR field2:value) > > > > ... however, we feel a bit uncomfortable doing this though via String > > manipulation. > > > > Is there an obvious way we should tackle this problem that we are missing > > (e.g., which would be cleaner/safer and perhaps works at the Query object > > level)? > > > > Many thanks and best wishes, > > > > Edd > > >
Re: Multiple "df" fields
why not use a copyfield for indexing? On Tue, Aug 11, 2020 at 9:59 AM Edward Turner wrote: > Hi all, > > Is it possible to have multiple "df" fields? (We think the answer is no > because our experiments did not work when adding multiple "df" values to > solrconfig.xml -- but we just wanted to double check with those who know > better.) The reason we would like to do this is that we have two main field > types (with different analyzers) and we'd like queries without a field to > be searched over both of them. We could also use copyfields, but this would > require us to have a common analyzer, which isn't exactly what we want. > > An alternative solution is to pre-process the query prior to sending it to > Solr, so that queries with no field are changed as follows: > > q=value -> q=(field1:value OR field2:value) > > ... however, we feel a bit uncomfortable doing this though via String > manipulation. > > Is there an obvious way we should tackle this problem that we are missing > (e.g., which would be cleaner/safer and perhaps works at the Query object > level)? > > Many thanks and best wishes, > > Edd >