mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-12-22 13:45:02 +00:00
Bugfix: Don't search page titles and tags for stop words
This commit is contained in:
parent
3bf9274647
commit
96fcbb90de
4 changed files with 12 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
|||
### Fixed
|
||||
- Clear the page id index out when rebuilding the search index from scratch.
|
||||
- This is needed to correct some issues where the id index goes all weird and assigns the same id to multiple pages
|
||||
- Don't search page titles or tags for stop words - it skews results since we don't search the page body for them
|
||||
|
||||
|
||||
## v0.13-beta1
|
||||
|
|
|
@ -3143,6 +3143,11 @@ class search
|
|||
{
|
||||
$qterm = $query_terms[$i];
|
||||
|
||||
// Stop words aren't worth the bother - make sure we don't search
|
||||
// the title or the tags for them
|
||||
if(in_array($qterm, self::$stop_words))
|
||||
continue;
|
||||
|
||||
// Only search the inverted index if it actually exists there
|
||||
if(isset($invindex[$qterm]))
|
||||
{
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
"author": "Starbeamrainbowlabs",
|
||||
"description": "Adds proper search functionality to Pepperminty Wiki using an inverted index to provide a full text search engine. If pages don't show up, then you might have hit a stop word. If not, try requesting the `invindex-rebuild` action to rebuild the inverted index from scratch.",
|
||||
"id": "feature-search",
|
||||
"lastupdate": 1490303523,
|
||||
"lastupdate": 1490304275,
|
||||
"optional": false
|
||||
},
|
||||
{
|
||||
|
|
|
@ -598,6 +598,11 @@ class search
|
|||
{
|
||||
$qterm = $query_terms[$i];
|
||||
|
||||
// Stop words aren't worth the bother - make sure we don't search
|
||||
// the title or the tags for them
|
||||
if(in_array($qterm, self::$stop_words))
|
||||
continue;
|
||||
|
||||
// Only search the inverted index if it actually exists there
|
||||
if(isset($invindex[$qterm]))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue