Comments (6)
I'm finding more and more search terms where this is the case. (Despite recreating the indexes again.)
What might be the reason a ModelIndex class doesn't populate the .wrappers or work with .each some of the time? (In some search terms, the first page (25 results) is displayed correctly, but any subsequent pages, though they exist according to the total, have no .wrappers or .each, but are correct and accessible via .first(n).
from chewy.
I have upgraded my app to Rails 6.1 and Ruby 3.2.1, but the behavior is unchanged.
Would it be possible for @pyromaniac or one of the other maintainers to offer thoughts on what might be causing this behavior, where results are correct, .total_pages is correct, but .wrappers is [] on page 2 and onwards with Kaminari?
from chewy.
Further finding:
when a search has, say, 285 result pages (at 25 results per page), some pages load fine, including 1, 2, and 285 (the last one), and others with empty .wrappers as above (pages 281, 284). This behavior is consistent for this particular search.
(my index is fresh and up to date, verified with rake chewy:reset)
from chewy.
Unfortunately, the persistence of this issue is forcing me to ditch Chewy in favor of plain Elasticsearch. :(
from chewy.
In a last-ditch effort, I traced into Chewy and into elastic-transport, and have found the problem:
"type"=>"illegal_argument_exception", "reason"=>"The length [1134481] of field [fulltext] in doc[7882]/index[manifestations_1678539023000] exceeds the [index.highlight.max_analyzed_offset] limit [1000000]. To avoid this error, set the query parameter [max_analyzed_offset] to a value less than index setting [1000000] and this will tolerate long field values by truncating them."}
This Elastic error was indeed introduced in 7.x, so explains this happening after my upgrade. It being a function of document size explains the apparent randomness of its occurrence, but consistently for particular search terms.
It seems to me that this error is somehow ignored or missed by Chewy, which just returns those pages without results. So while I will solve my issue by changing the setting, I do believe there is a Chewy issue here as well.
Thoughts?
from chewy.
(for anyone who's run into this and is looking for a quick fix, adding the max_analyzed_offset parameter to the highlight method solves the issue.)
index.highlight(max_analyzed_offset: 999000, fields: {fulltext: {}})
from chewy.
Related Issues (20)
- Mapping fields is not working after upgrade from version 5
- Index field looses date precision if type not explicitly set to `date` (and causes sync to always update all documents)
- Unknown key for a START_ARRAY in [index].
- How do I connect to an Elastic instance at https://cloud.elastic.co/
- Bug in the `mock_elasticsearch_response_sources` method
- Redundant crutch call when :update_fields does not contain related field
- bundle gem chewy 7.2.x auto install gem elasticsearch 8.x ?? HOT 8
- Support PITs (points in time) and search_after HOT 4
- is there a way to set `Chewy.strategy(:lazy_sidekiq)` globally? to make all updates asynchronously HOT 2
- Readme comment on Ruby 3 + Rails 6.1
- `Elasticsearch::Transport::Transport::Errors::Found`
- Cleanup journal throws `Yajl::EncodeError: Max nesting depth of 256 exceeded`
- Old indices are not being cleared up after a reset
- Port PR #874 to the 7.0.x branch
- Trying to use Pagy pagination with Chewy, running into autoloading will_paginate gem
- Breaking change at 7.2.4
- I have a question regarding elasticsearch-ruby gem
- Support rails parallel testing HOT 1
- Warning when upgrading to Rails 7.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chewy.