Coder Social home page Coder Social logo

Comments (2)

vbier avatar vbier commented on June 29, 2024

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.

vbier avatar vbier commented on June 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.