Repository navigation
JSPWIKI-1321 Match wildcards inside the words of a page name and keep… - #575
arturobernalg wants to merge 2 commits into
Conversation
… the relevance up to 100 A term of the name field with a * between other characters, such as blog*26, is also looked for inside the words of the name, and its parts in order in different words. The relevance of a result is scaled so that the best one is 100.
|
@udittmer, this pull request covers what you asked for in the review of #543. With a page named |
|
@udittmer, thanks for trying it. You are right that the rule is not general: a term with an inner * is looked for inside the words, but Before I change anything, which rule would you expect for the name field? Should About the bars: the number is capped at 100 now, but the bars are drawn by GraphBar.js, which makes the smallest bar 40 px and the largest 440 px and everything else linear in between, so the cap does not change them. In your screenshot 100, 29 and 23 are about 880, 142 and 80 px wide, which is what that formula gives. Should the bar be proportional to the number (29 is 29% of the width), or is the current look fine and only the number mattered? |
|
Thinking about this some more, I actually think it's OK for "entry" not to find anything, given that it is in the middle of the word. In which case entry*26 also should not return any results. I guess that point is debatable, and maybe just a design decision. When implementing Lucene solutions, I sometimes use porter stemming analyzers, so that searching for "entries" would also find "entry". But given the stemming operation, I wouldn't then expect to find any random string that occurs in the middle of a word. So the question would be: should one expect to find strings in the middle of words, or just from the beginning? That is at least partly a matter of personal preference. As to the bar chart, my expectation would be for the length of the bar to be strictly proportional to the value. So if the minimum was barely visible, that would reflect its low value. |
|
Thanks, that is a fair point. I measured a few searches with the code of #543 (what master has now) and with this pull request, on 11 pages: UnserBlog, four UnserBlog_blogentry pages, three Weblog_blogentry pages, Man_Page, Human_Page and Woman_Page. On master, name:blog26 finds 0 pages but name:blog26* finds 3, and name:manpa finds 0 although name:man* finds Man_Page. With this pull request name:entry26 finds 3 pages, name:manpa* finds Man_Page, Human_Page and Woman_Page, and name:blog1 finds 6 pages instead of 5. name:entry and name:entry find nothing in both. If matches should only start at the beginning of a word, I would drop the part of this pull request that looks inside the words, so that name:entry26 finds nothing, and make a * at the end optional, so that name:blog26 and name:blog26 both find UnserBlog_blogentry_261023_1, Weblog_blogentry_021126_1 and Weblog_blogentry_031226_1. Is that what you would expect, or should name:blog*26 find nothing? About the bars, I will do that in a separate ticket, so that the bar is strictly proportional to the value. |

JSPWIKI-1321, a follow-up of JSPWIKI-501 from the review of pull request 543.
A term of the name field with a
*between other characters, such asblog*26, is now also looked for inside the words of the name, and its parts are looked for in order in different words.name:blog*26andname:entry*26*findWeblog_blogentry_021126_1. A term that only ends in*, such asname:man*, still starts at the word. Only the name field changes.The relevance of a result is scaled so that the best one is 100. Before, values above 100 appeared.
Tests: three new ones in SearchManagerTest fail on the code of pull request 543 and pass here. SearchManagerTest has 16 tests and all pass. Not run: the whole test suite, the cost of terms with an inner
*on a large index, and the contents field.https://issues.apache.org/jira/browse/JSPWIKI-1321