Open jeremylynch opened 9 months ago
Hello @jeremylynch Thanks for the report!
@ellnix if you are around, I would love to have your help on this 😊 Do you know where it could come from? Thank you very much for your help
There are models with filterable_attributes set in the test suite and they seem to be behaving normally. There have been some changes to the settings logic but they are not included in v0.10.2.
... reindexing the model (
Manufacturer.reindex
), ...As shown below, the
filterable_attributes
are clearly defined under the model:filterable_attributes [ 'manufacturer.name' ]
This does not look like it was defined in the
Manufacturer
model, but rather anOffer
model of some kind (judging by the index name). If I am correct, then this block would have been run onOffer.reindex!
, notManufacturer.reindex!
.
If that is not the case let me ask some follow up questions:
Offer_production
index set on the Manufacturer
model?Apologies, in my original issue I had Manufacturer.reindex!
this should have been Offer.reindex!
which created the confusion in your question (I have since edited the original question).
The issue was cause by simply deleting the index, and then attempting to reindex all the records (with Offer.reindex!
)
I encountered the same issue:
Meilisearch definition:
meilisearch enqueue: :sync_article_to_meilisearch do
searchable_attributes [:title, :description]
filterable_attributes [:id, :type]
attribute :type
attribute :title
attribute :created_at
attribute :description
attribute :published
end
def self.sync_article_to_meilisearch(article, remove)
if published && !remove
article.index!
else
Article.index.delete_document(article.id)
end
end
Then I call
Article.index.delete # Make sure the index does not exist
Article.reindex!
The settings
irb(main):004:0> Article.index.settings
=>
{"displayedAttributes"=>["*"],
"searchableAttributes"=>["*"],
"filterableAttributes"=>[],
"sortableAttributes"=>[],
"rankingRules"=>["words", "typo", "proximity", "attribute", "sort", "exactness"],
"stopWords"=>[],
"synonyms"=>{},
"distinctAttribute"=>nil,
"typoTolerance"=>{"enabled"=>true, "minWordSizeForTypos"=>{"oneTypo"=>5, "twoTypos"=>9}, "disableOnWords"=>[], "disableOnAttributes"=>[]},
"faceting"=>{"maxValuesPerFacet"=>100},
"pagination"=>{"maxTotalHits"=>1000}}
We have recently upgraded to meilisearch 1.6.0, and are using meilisearch-rails 0.10.2.
We recently ran into an issue where we had to delete an index and then re-create it. However, after deleting the index, and then manually reindexing the model (
Offer.reindex
), we had an error forAttribute "manufacturer.name" is not filterable
.As shown below, the
filterable_attributes
are clearly defined under the model:To fix this, I had to manually execute the below:
Why would the
filterable_attributes
not have been automatically set when callingManufacturer.reindex!
? Is this gem compatible with Meilisearch 1.6 ?