NeowayLabs / neosearch

Full Text Search Library
30 stars 4 forks source link

[FEATURE] Support for object/nested field. Closes #28 #29

Closed i4ki closed 9 years ago

i4ki commented 9 years ago

Simple implementation for nested/object fields using a recursive approach.

To test with command-line:

# Create the index
curl -XPUT http://localhost:9500/test-object
>> {"status": "Index 'test-object' created."}
# Index a nested document
curl -H "Content-Type: application/json" -X POST -d '{
    "name": "Neoway Business Solution", 
    "address": {
        "city": "Florianópolis", 
        "street": "Patricio Farias"
    }
}' http://localhost:9500/test-object/1
>> {"status": "Document 1 indexed."}
# Search in nested field
curl -H "Content-Type: application/json" -X POST -d '{
    "query": {
        "$and": [
            {"address.city": "florianópolis"}
        ]
    }
}' http://localhost:9500/test-object
>> {"results":[{"address":{"address":"Patricio Farias","city":"Florianópolis"},"name":"Neoway Business Solution"}],"total":1}
codecov-io commented 9 years ago

Current coverage is 53.69%

Merging #29 into master will change coverage by +1.40% by 2a120b5

Coverage Diff

@@            master     #29   diff @@
======================================
  Files           20      20       
  Stmts         1813    1842    +29
  Branches         0       0       
  Methods          0       0       
======================================
+ Hit            948     989    +41
  Partial          0       0       
+ Missed         865     853    -12

Uncovered Suggestions

  1. +1.36% via ...arch/index/filter.go#65...89
  2. +1.30% via ...b/neosearch/index.go#215...238
  3. +1.30% via ...arch/index/filter.go#10...33
  4. See 7 more...

Powered by Codecov