Comments (2)
I have tried to understand the source code, and as far as I could, the function generateSearchQueryAccess in https://github.com/nextcloud/fulltextsearch_elasticsearch/blob/master/lib/Service/SearchMappingService.php#L307 restricts the found documents by permissions. It either has to be owned by the current user, be shared with him, be public or shared with a group or circle he is member of.
When I look at my indexed document, I can see that the owner matches the current user id, but the document is not found regardless. If I change the query to be a match query instead of a term, all documents seem to be found as expected. Reading up on ElasticSearch documenation, I can not see why this should be the case for a keyword field. So this does not seem to be the proper fix.
But I do not have the knowledge to investigate this further. Maybe somebody else can pick up here. The problem IMHO does not exist in the fulltextsearch code, but rather in the fulltextsearch_elasticsearch code.
from fulltextsearch.
After checking the index mapping I realized that the users and owner fields are of type text, which completely explains why a term query can not find the userids with blanks are special characters:
"users" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
"owner" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
The fields either need to be of type keyword, or the code in SearchManager.php needs to be changed to work on the subfields owner.keyword and users.keyword. Then the term query works as expected.
I have written an issue in the correct github project: nextcloud/fulltextsearch_elasticsearch#300
from fulltextsearch.
Related Issues (20)
- Migration of `default collection is local` during update leads to longer downtime HOT 1
- Fulltextsearch V 27.0.1 not live-indexing?
- fulltextsearch:index always scans all files even if index is already available HOT 5
- Indexing a file does not work when it's uploaded to a directory that is synced with Nextcloud desktop app
- No results when searching HOT 6
- Fulltextsearch: CSV data is not indexed correctly, issue in recognizing semicolons within numeric sequences HOT 1
- The settings cannot be saved after the recent update HOT 1
- Exception: Database error when running migration 2801Date202309200001 for app fulltextsearch HOT 10
- Fulltextsearch hangs with complex PDF due to Ghostscript bug in version 10.0.0
- Question: When ES is working for files and deck provider how to switch off DB operation for those providers?
- 0 results, test returns "Unexpected SearchResult" error HOT 6
- fulltextsearch:index decrypts and copies all files to /tmp HOT 7
- indexing OpenOffice documents - first line after headline missing
- Links to results are wrong when searching in the desktop client HOT 2
- Search returns no results HOT 3
- Constantly getting warning message Exception while improving searchresult HOT 2
- Fulltextsearch upgrade fails 27.0.1 -> 27.1.4 HOT 13
- List of Platform Apps: Add Xapian
- Search return only results from filenames HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fulltextsearch.