Skip to content

Commit

Permalink
analyzeDoc endpoint update
Browse files Browse the repository at this point in the history
analyzeDoc endpoint wasn't analysing documents
with any arbitrary type when the default mapping
was enabled.
This change fixes that.

Change-Id: I50628ab7d14fde7c19a8c3d9b50d135a522de7d0
Reviewed-on: http://review.couchbase.org/113735
Well-Formed: Build Bot <build@couchbase.com>
Reviewed-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Sreekanth Sivasankaran <sreekanth.sivasankaran@couchbase.com>
  • Loading branch information
sreekanth-cb committed Aug 23, 2019
1 parent 5df8b92 commit 6615a1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pindex_rest_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func AnalyzeDoc(mgr *cbgt.Manager, indexName, indexUUID string,
}

var cbftDoc *BleveDocument
cbftDoc, err = bdest.bleveDocConfig.BuildDocument(nil, req, defaultType)
cbftDoc, err = bdest.bleveDocConfig.BuildDocument([]byte("key"), req, defaultType)
if err != nil {
return err
}
Expand All @@ -111,7 +111,7 @@ func AnalyzeDoc(mgr *cbgt.Manager, indexName, indexUUID string,
return err
}

doc := document.NewDocument("dummy")
doc := document.NewDocument("key")
err = bindex.Mapping().MapDocument(doc, cbftDoc)
if err != nil {
return err
Expand Down

0 comments on commit 6615a1a

Please sign in to comment.