0

I have rangeInput field, which has Min and Max input, where user can add price to search, I have below code for price search.

customRangeInput({
  container: document.querySelector('#range-input'),
  attribute: 'price',
  }),

and I am adding as facet like below:

 curl \
  -X POST 'https://search.example.com/indexes/maps/settings' \
  --data '{
      "searchableAttributes": [ "price" ]
  }' -H "X-Meili-API-Key: xxxxxx"

but it says Price is not set as facet. can we not se numeric value in facet? (Attribute price is not set as facet) any help would be great.

Thanks Sanjay

sanj
  • 1
  • 2

1 Answers1

0

In the current version of MeiliSearch you can perform faceting on attributes that are either String or [String]. The whole core team is currently working on a new search engine that will be released with v0.21.0 and will accept numeric values too :)

CaroFG
  • 407
  • 2
  • 5
  • is there any way around for it? @CaroFG, how can I still perform search on this? or is only allowed in algolia? – sanj May 12 '21 at 17:58
  • Maybe by using [filters](https://docs.meilisearch.com/reference/features/filtering.html) instead of facets, it could work if your dataset is not too big. Otherwise, you would have performance issues… – CaroFG May 12 '21 at 18:07
  • and algolia search allowed this facet in number? @CaroFG – sanj May 12 '21 at 18:11
  • I am not very familiar with Algolia, but I think so, since instant-search is a library created by Algolia – CaroFG May 12 '21 at 18:32
  • Also, be careful with your master key :) Anyone can access your instance with it – CaroFG May 12 '21 at 18:36
  • would mind giving any example of filter? search.addWidgets([ instantsearch.widgets.configure({ filters: date_timestamp > ${today} }), ]); I got this, but not sure how to pass variable in it from form. @CaroFG – sanj May 13 '21 at 03:06
  • is there anyway to work min/max filter in Meilisearch? – sanj May 13 '21 at 07:45