Closed (fixed)
Project:
Search API
Version:
7.x-1.x-dev
Component:
Views integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Apr 2013 at 11:55 UTC
Updated:
19 May 2014 at 20:51 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
tvn commentedHappening to us on D7 Drupal.org as well. Search API 7.x-1.9. See issue #2118545: /project/issue/search returns results on two-character results.
Comment #2
drunken monkeyOK, I see that with Views this doesn't even show a warning that words were ignored, which is of course bad. So one thing is, we should definitely fix Views to resolve this, i.e., (provide a way to) show any keywords that were ignored. Either by always outputting them (like the errors) or by providing an area handler listing them. (Or is it possible to just supply it as a token for area handlers, so users could just use a custom text?)
For displaying no results if no keys were present, we have several options. One question is whether this should always be the case – if so, then just fixing the database backend to do that seems like the proper solution. If this should be optional, the question is whether we should include the option for the server or for the view. For the server, the implementation would be cleaner and easier, but in the view it would allow finer-grained control (since different views could be configured differently). So it depends how likely you think it is that someone would want to display all results, and whether there would likely be anyone who wants this for some but not all searches.
Comment #3
tvn commentedThe way D6 D.o shows warnings now is good: error message saying that user didn't input enough characters and the search field highlighted.
I don't think it's very likely that someone would want to display all results when searching for word shorter than minimum word length. That's confusing as the results displayed won't have any relation to whatever the person was searching for.
Comment #4
drunken monkeyHm, for that to work (without larger hacks), I think we'd have to include that as an additional option for the "Search: Fulltext search" filter. Otherwise, there's no real/clean way to show a validation error for the field. Would that be OK? (I.e., that you'd have to set the same minimum word length on both the search server and the Views filter.)
Comment #5
tvn commentedThat'd be ok I think. In fact I was looking for a setting exactly there, while trying to figure out how to fix that on git7site :)
Comment #6
drunken monkeyOK, that should be easy. Patch attached, please test/review!
Comment #7
tvn commentedApplied the patch on my dev site, updated the view and it works just fine.
http://tvn7-drupal_7.redesign.devdrupal.org/project/issues/search?text=j...
(User/pass drupal/drupal to access)
Comment #8
drunken monkeyThanks for testing, good to hear it works!
Committed.
Comment #10
tvn commentedSo we have Search API with this patch on D.o, but it seems validation still isn't working for words shorter than minimum word length. Please, see this comment: https://drupal.org/comment/8614065#comment-8614065
Comment #11
drunken monkeySorry for not answering earlier! I'm currently busy with the D8 port and therefore only process the D7 issues on a approximately monthly basis. Also, it seems this issue has slipped from my notice on top of that, for some reason.
Since I also don't log in to Twitter regularly, please just send a mail next time! D.o issues do have priority. ;)
Anyways, I answered in the other issue. A bit confusing.
Comment #12
tvn commentedThanks, Thomas. Will do email next time :)
Closing this one again, see my follow up in the other issue.