Ahh, so yes, now I see. That is probably a better approach as we actually implement this.
-----Original Message----- From: Jan Høydahl <jan....@cominvent.com> Sent: Friday, September 10, 2021 10:12 AM To: users@solr.apache.org Subject: Re: qf with multiple fields in _query_ with edismax And if you fancy looking into the JSON Query DSL (https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsolr.apache.org%2Fguide%2F8_9%2Fjson-query-dsl.html&data=04%7C01%7Candy.coulson%40epicor.com%7C7c415b72e40a43705df108d9746d69f2%7C4f4f4c56a772461a967e7890c3960b3a%7C1%7C0%7C637668835539221078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=IZSMQApxuiGbfOFRogQ%2BN1z6nUmAc1fq1BJgxk2FWVA%3D&reserved=0) then it would look something like this curl -X POST http://localhost:8983/solr/techproducts/query -d ' { "query": { "bool": { "must": [ "name:iPod", "cat:electronics", {"edismax": {"qf": "cat name", "pf": "cat^10", "mm": "100%", "query": "mini"}} ] } } }' Unfortunately we don't have good Admin UI support for editing JSON DSL yet. Jan > 10. sep. 2021 kl. 16:33 skrev David Hastings <hastings.recurs...@gmail.com>: > > Do you mind if I ask why not use a post to solr? > > On Fri, Sep 10, 2021 at 10:18 AM Andy Coulson > <andy.coul...@epicor.com> > wrote: > >> Thanks Erik, >> >> That did the trick! My real use case will have additional predicates >> - I merely trimmed it down to reproduce and illustrate the problem. I >> real query will probably be something like (without encoding): >> >> q= locale:en AND thingType:part AND _query_:"{!edismax >> qf='object_name thing_name' pf=thing_name^10 v=$qq >> mm=$minMatch}"&qq=clutch cable&minMatch=100%&fl=*,score >> >> -----Original Message----- >> From: Erik Hatcher <erik.hatc...@gmail.com> >> Sent: Friday, September 10, 2021 8:40 AM >> To: users@solr.apache.org >> Subject: Re: qf with multiple fields in _query_ with edismax >> >> Andy, >> >> Use single quotes around the inner parameters, such as {!edismax >> qf='object_name thing_name'}. Going even further, use the `v` >> parameter to encapsulate the query string inside as well, as the parser eats >> everything >> after the closing curly bracket otherwise. {!edismax qf='object_name >> thing_name' v='r'}. Beyond that, if the query string is potentially >> complex, and may itself contain a single quote, use param indirection.... >> >> q={!edismax qf='object_name thing_name' v=$qq mm='100%'}&qq=r >> >> If you're only doing a single edismax, then using the _query_ here is >> not necessary though. >> >> Erik >> >> >> >>> On Sep 9, 2021, at 5:23 PM, Andy Coulson <andy.coul...@epicor.com> >> wrote: >>> >>> There is precious little documentation on the _query_ magic field, >>> but >> from what I understand, it should take whatever parameters are >> supported by parser. >>> I am trying to provide multiple filed names to the qf parameter, but >> nothing I try works. Examples I have found googling indicate my >> syntax should be ok. >>> >>> I am using the edismax parser and version 6.6 >>> >>> I try this, where the term "r" does exists in thing_name (but not in >> object_name), but get no results: >>> http://localhost:8983/solr/myCore/select?q=_query_ < >> http://localhost:8983/solr/myCore/select?q=_query_ >>> :"{!edismax%20qf=object_name%20thing_name}r"&fl=*%2Cscore >>> >>> example also suggest that having the fl parameter inside the braces >> should work, but it is ignored, as are other edismax params like mm. >>> >>> Andy Coulson >>> Principal Software Engineer >>> Epicor Software Corporation >>> www.epicor.com <http://www.epicor.com/> >>> Tel.: (512) 328-2300 >>> Cell: (512) 517-2494 >>> E-Mail: andy.coul...@epicor.com <mailto:andy.coul...@epicor.com> >> >>