Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-53

Incorporating JSearch to CouchDB

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Later
    • None
    • None
    • None
    • None
    • JSearch is developed in Java

    Description

      JSearch is a prototype that we developed for indexing and searching Json documents, and we are enthusiastic about contributing it to CouchDB. JSearch converts a given Json document to a Lucene document for indexing. The conversion is lossless and preserves all structural information in the original Json document. We achieve that by storing the encoding of Json structures in the payload of the posting list in a Lucene index. JSearch has a simple query language that combines fulltext search and structural querying. To qualify as a match, a document has to match both the JSON structures as well as the Boolean constraints specified in the query. Suppose that we have indexed the following two JSON documents:
      d1={ A: [

      { B: "b1", C: "c1" }

      ,

      { B: "b2", C: "c2" }

      ,
      ]
      }
      d2={ A: [

      { B: "b1", C: "c2" }

      ,

      { B: "b2", C: "c1" }

      ,
      ]
      }
      One can issue the following two JSeach queries.
      P={ A: [

      { B: "b1" && C: "c1" }

      ] }
      Q={ A: [

      { B: "b1"}

      &&

      {C: "c1" }

      ] }
      Query P ("&&" specifies conjunction) matches d1, but not d2. The reason is that d2 doesn't have the proper B and C fields within the same JSON object. On the other hand, query Q matches both d1 and d2, since it doesn't require the B field and the C field to be in the same JSON object.

      Here is a summary of the querying features in JSearch
      1. arbitrary conjunctive and disjunctive constraints
      2. text search on atomic values of string type
      3. range constraints on atomic values (only those of string and long types are currently supported)
      4. document level matching

      The easiest way to know more about JSeach is to give it a try. Download the attached tgz file. Follow the readme file in it and try some of the examples. The attachment also includes all Java source code (I can provide more technical details if needed). I am very interested in your feedback. Does JSearch fit into CouchDB? What other features are needed? How should JSearch be integrated (from Jan's mail, it seems that some infrastructure is already in-place)? Thanks,

      Attachments

        1. jsearch_full.tgz
          1.23 MB
          Jun Rao

        Activity

          People

            paul.joseph.davis Paul Joseph Davis
            junrao Jun Rao
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: