Privacy settings in fts with node js

i want do partial privaciy settings in my document for example
"firstname ":“alice”,
“lastname”:“crush”

if user want hide lastname in search,how i can do it ?
i can add more field for privacy that use which field in privacy like
"privacy":[“lastname”,“more field name”] or i can convert each field for privacy like
"lastname":{“value”:“crush”,
“privacy”:true or 1 or “yes”
}
and how i configure this for fts setting
if couchbase cant do it i have to manipule in node js

also
I would like to get into some field of direct privacy
please explain me
thanks

Hi @stuff.095,

I’m not entirely sure what you’re asking, but I’ll do my best.

I think you’re asking one of two things. You either want to do a search based on a particular field, not all fields, or you want to do a search and return only specific fields. If your question is related to neither, stop me now and we’ll try again.

If you want to search based on a particular field, you can define such in your FTS index:

In my screenshot, notice how I’ve defined a specific type and chose to only index specific properties. In this case I’ve only chosen to index the firstname field.

If your question is related to returning certain fields rather than search on certain fields, two things should happen.

  1. When creating your index, only choose the store option on the fields you want to store
  2. In your Node.js code, specify the fields you want to return such as query.fields(["firstname"]) and only those fields will be returned.

Hopefully that helped.

Best,

@nraboy sorry for late reply

actually i asked what you say, but it depends on json data
i mean fts must search every field but if json data has privacy field , fts should remove this field which is in privacy field .
secondly
fts should not search this field which is in privacy field

it can be call dynamic type mapping,it seems very complex :slight_smile:
finally
thanks for reply,i solved with manipule in nodejs