0

I'm using Cloudant and I created a search index. However, I'd like the index to return the term I'm querying. I mean I want to get a data which has a specific date that I chose.

1.) I have created a cloudant database and loaded it with some data. enter image description here

2.) I have created a search index.

enter image description here

3) Node set-ups enter image description here

4) And function content.

enter image description here

I've expected to see whole data about this exact "ts" variable. But I got this:

enter image description here

I have been struggling with this for a few days and can't seem to get this working. I am sure it's just a Newbie issue. Many thanks in advice.

emily.mi
  • 161
  • 12

1 Answers1

0

A search index uses the Apache Lucene library for text pre-processing and indexing. It's designed for chopping up sentences into words and words into stemmed tokens for "free text" search, i.e. finding the documents that best match a multi-word phrase. You can optionally choose the type of stemming which is performed by specifying the "analyzer" when creating the index, that is the text pre-processing algorithm used to break up the strings.

If you want to keep the string intact, then choose the "keyword" analyzer:

enter image description here

You may also want to investigate using Cloudant Query, whose type=json indexes would not pre-process your timestamp string.

Glynn Bird
  • 5,507
  • 2
  • 12
  • 21
  • Thank you for the descriptive explanation. I have tried "Keyword" option as you said but unfortunately, there is no difference in debug output. – emily.mi May 22 '18 at 08:20