Thanks for the quick replies. Jack was right, I switched to space as separator and it works.

2) &f.name.qf=last_name_text,first_name_text
- returns 0 results, debug shows <str name="f.name.qf">last_name_text,first_name_text</str>
+DisjunctionMaxQuery((last_name_text,first_name_text:maier))

8) &f.name.qf=last_name_text first_name_text
- returns 39 results, debug shows <str name="f.name.qf">last_name_text first_name_text</str>
+DisjunctionMaxQuery((last_name_text:maier | first_name_text:maier))

So the docs are wrong as the example uses a comma. Should I raise a JIRA issue for that?

Thanks Jan for the hint regarding parsedquery, I'll make sure to include it in my reports next time.

Best,

Nils

Am 08.08.2012 15:06, schrieb Jack Krupansky:
Jan, I did notice that you used a space rather than a comma in the alias field list. The wiki does indicate comma (which is what Nils used), but... who knows. I haven't checked the code yet.

-- Jack Krupansky

-----Original Message----- From: Jan Høydahl
Sent: Wednesday, August 08, 2012 9:03 AM
To: solr-user@lucene.apache.org
Subject: Re: Problems with EDisMax field aliases for multiple fields on Solr 3.6.1

Hi,

It's hard to see what's going on without knowing more about your schema and documents. Also, it would be more helpful if you could paste the "parsedquery" part of the DebugQuery, where you actually see how the query was interpreted. Your query syntax looks correct, and I just verified that the feature works on a clean 3.6.1.

I indexed all xml's in example/exampledocs, then ran this query:

http://localhost:8983/solr/select?debugQuery=true&q=foo:drive&fl=*%20score&defType=edismax&f.foo.qf=name^1%20features^2

Here's what my debug looks like:
<str name="querystring">foo:drive</str>
<str name="parsedquery">+DisjunctionMaxQuery((features:drive^2.0 | name:drive))</str>

You see that the query string is being parsed correctly, and we get three hits (vs 2 in name and 1 in features alone).

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Solr Training - www.solrtraining.com

8. aug. 2012 kl. 13:41 skrev Nils Kaiser <m...@nils-kaiser.de>:

Hey,

I'm trying to use field aliases that reference multiple fields on Solr 3.6.1 (1362471) as stated in the EDisMax documentation (http://wiki.apache.org/solr/ExtendedDisMax#Field_aliasing_.2BAC8_renaming).

If I use an alias for a single field, everything is fine, but once I use an alias with more than one field (using syntax f.who.qf=name^5.0,namealias^2.0 as in the docs), the alias stops working.

Examples
(base url is http://localhost:8982/solr/select?debugQuery=true&fq=type%3AUser&q=name%3Amaier&fl=*+score&defType=edismax&rows=10 + params below, debug shows how f.name.qf is displayed in debug xml view)

1) &f.name.qf=last_name_text
- returns 39 results, debug: <str name="f.name.qf">last_name_text</str>

2) &f.name.qf=last_name_text,first_name_text
- returns 0 results, debug: <str name="f.name.qf">last_name_text,first_name_text</str>

3) &f.name.qf=last_name_text%2Cfirst_name_text
- returns 0 results, debug: <str name="f.name.qf">last_name_text,first_name_text</str>

4) &f.name.qf=first_name_text&f.name.qf=last_name_text
- returns 0 results, debug: <arr name="f.name.qf"><str>first_name_text</str><str>last_name_text</str></arr>

5) &f.name.qf=last_name_text&f.name.qf=first_name_text
- returns 39 results, debug: <arr name="f.name.qf"><str>last_name_text</str><str>first_name_text</str></arr>

6) &f.name.qf=last_name_text^2.0,first_name_text^2.0
- http error 500, java.lang.NumberFormatException: For input string: "2.0,first_name_text"

7) &f.name.qf=last_name_text^2.0%2Cfirst_name_text^2.0
- http error 500, java.lang.NumberFormatException: For input string: "2.0,first_name_text"

Comments:

1) works as expected, but uses only one field for the alias
2) does not work, but this format is explained in the docs if I understood it right
3) tried this to try escaping issues, but xml shows the same value
4) does not work, because SOLR seems to take first value only
5) does work, but only because SOLR takes first value (see 4)
6), 7) lead to http error, but format is same as in docs??

Any ideas whether I am doing something wrong here, or the docs are misleading, or there is a bug in the SOLR version I use?

Best,

Nils



--
Nils Kaiser
MSc in Information Systems

Reply via email to