Closed nielsklazenga closed 7 years ago
The first example says the URL was produced from the advanced search page but doesn't say which fields were entered by the user, therefore its hard to reproduce.
The example provided appears to result from the user typing "Synaphea petiolaris" into the full text field and then selecting "WA Herbarium" from the herbarium drop-down, so the URL looks OK to me (see below)
text:
field is the "default" field if no field is provided, therefore the terms don't need to be enclosed. E.g. http://avh-test.ala.org.au/occurrences/search?q=Synaphea+petiolaris+collection_uid%3Aco75 provides the same number of results (as the first URL in issue), as does http://avh-test.ala.org.au/occurrences/search?q=Synaphea+petiolaris&qc=data_hub_uid:dh9&fq=collection_uid%3A%22co75%22text
is the field name, as explained above.matched_name_children
field has not been indexed correctly in biocache-service. Fix is to use the taxon_name
field, as suggested. There was a reason we implemented matched_name_children
just for AVH many years ago (I can't remember why though), so it would be good to check that this OK to use taxon_name
.1 Covered above
2 Only the text:
field omits quotes (which has no affect on results, as explained above), taxon name
field already encloses pasted text in quotes, so changing field should fix the problem.
3 This doesn't make sense to me. I think you are confused by the fact that text:
is a field, so it doesn't make sense embeding taxon_name:
inside it - you can't embed fields inside fields.
4 Yes agree with this. SOLR allows you to set a default Boolean operator, which we have as AND
but if we later change it to OR
, then searches would work differently. Explicitly setting AND
would prevent that and make it easier to read. Only minor issue is URLs get bigger and there is a potential to hit the max length in GET.
I think the difference with taxon_name
and matched_name_children
might've been related to what child taxa are included in the results. the former will return all lower ranks including things like varieties and forms, where the latter did not (just a guess).
If that is the case, that's what we want, but the field name would be misleading. matched_name_children suggests to me that it will also include the children if, say, the search string is a family name (which is not part of the name of any of the children).
Basically what people expect is all taxa of which the name starts with the search string.
For everything else above, as long as it works I'm good (and please never change the default boolean operator to 'OR').
taxon_name
does a match to a name in our taxonomy and then just searches on that taxon. So keep it to use this?
E.g. http://avh-test.ala.org.au/occurrences/search?q=taxon_name:Acacia
We want it to do this: http://avh-test.ala.org.au/occurrences/search?q=taxon_name:Acacia*
I've got an open issue to fix matched_name_children
in biocache-service but in the meantime, I've hooked in the taxa
param to the taxon name fields, which seems to do the right thing...
Yes, works beautifully now. I like that the taxa bit of the query is displayed in the search box now as well. Thanks for hanging in there.
The reported issue was that this query: http://avh-test.ala.org.au/occurrences/search?q=text%3ASynaphea+petiolaris+collection_uid%3Aco75. which is produced by the Advanced query form, does not work.
I can see two problems with this query:
1 and 3 are issues in the query form, 2 is an issue with what has been filled in in the query form.
This works: http://avh-test.ala.org.au/occurrences/search?q=taxon_name:%22Synaphea%20petiolaris%22+AND+collection_uid:%22co65%22 and is a proper SOLR query, so that is what should come out of the query form.
So, three (four) simple things need to change on the query form: