2 Replies Latest reply on Oct 29, 2015 5:01 AM by hchiorean

    Queries using indexes always return 100 results only.

    folch

      Hello,

       

      I'm using Modeshape 4.4.0 and I've a repository with more than 20.000 documents (nodes with metadata) of a custom type.

      I'm trying to define indexes based on the queries that my app is doing and I'm getting always 100 results as maximum.

       

      This is my configuration for indexes.

       

      "node-types" : ["myTypes.cnd"],

          "indexProviders" : {

              "local" : {

                  "classname" : "org.modeshape.jcr.index.local.LocalIndexProvider",

                  "directory" : "index"

              }

          },

        "indexes" : {

              "docsByDeleted" : {

                  "kind" : "value",

                  "provider" : "local",

                  "nodeType" : "hes:document",

                  "columns" : "deleted(BOOLEAN)"

              }

        }

       

      All my documents are not deleted and I'm using a LIMIT 501 (via setLimit() method)

      • if I execute this query: select * from hes:document (with LIMIT 501). I receive 501 document results. If I'm not wrong I'm not using any index.
      • if I execute this query: select * from hes:document where deleted = false (with LIMIT 501). I only receive 100 documents. In that case I'm using the index.
      • if I execute this query: select * from hes:document where deleted = false (without LIMIT 501). I receive 20000 documents. In that case I'm using the index but not limiting the query.

       

      Is there a cofiguration somewhere to define a limit on the index results?

       

      Thanks in advance.

        • 1. Re: Queries using indexes always return 100 results only.
          hchiorean
          • if I execute this query: select * from hes:document (with LIMIT 501). I receive 501 document results. If I'm not wrong I'm not using any index.
          • if I execute this query: select * from hes:document where deleted = false (with LIMIT 501). I only receive 100 documents. In that case I'm using the index.
          • if I execute this query: select * from hes:document where deleted = false (without LIMIT 501). I receive 20000 documents. In that case I'm using the index but not limiting the query.

          Based on your last statement, the index seems to contain all the expected information (i.e. the index isn't corrupt/missing data). If that's the case, it's probably a bug somewhere around queries which have a limit set and which use indexes. If you can provide a test case for this, please log a JIRA. Thanks.

          • 2. Re: Queries using indexes always return 100 results only.
            hchiorean
            1 of 1 people found this helpful