-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhancement: improve content extraction stop word cleaning
- Loading branch information
Showing
6 changed files
with
72 additions
and
5 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
changelog/unreleased/enhancement-search-content-extraction-cleanup.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Enhancement: Tika content extraction cleanup for search | ||
|
||
So far it has not been possible to determine whether | ||
the content for the search should be cleaned of stop words or not. | ||
|
||
This can now be set with the newly introduced settings option `SEARCH_EXTRACTOR_TIKA_CLEAN_STOP_WORDS=false` | ||
which is enabled by default. | ||
|
||
In addition, the stop word cleanup is no longer as aggressive and now ignores numbers, urls, | ||
basically everything except the defined stop words. | ||
|
||
https://github.com/owncloud/ocis/pull/7553 | ||
https://github.com/owncloud/ocis/issues/6674 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package content_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/stretchr/testify/assert" | ||
|
||
"github.com/owncloud/ocis/v2/services/search/pkg/content" | ||
) | ||
|
||
func TestCleanContent(t *testing.T) { | ||
tests := []struct { | ||
given string | ||
expect string | ||
}{ | ||
{ | ||
given: "find can keeper should keeper will", | ||
expect: "keeper keeper", | ||
}, | ||
{ | ||
given: "user1 shares the file to Marie", | ||
expect: "user1 shares file marie", | ||
}, | ||
{ | ||
given: "content contains https://localhost/remote.php/dav/files/admin/Photos/San%20Francisco.jpg and stop word", | ||
expect: "content contains https://localhost/remote.php/dav/files/admin/photos/san%20francisco.jpg stop word", | ||
}, | ||
} | ||
|
||
for _, tc := range tests { | ||
tc := tc | ||
t.Run(tc.given, func(t *testing.T) { | ||
Equal(t, tc.expect, content.CleanString(tc.given, "en")) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters