Comments (7)
あと、現状のreorder
にid
が抜けていると思う。
from redmine_full_text_search.
ここで reorder しても、最後に Redmine 側で sort!
するようになっているのでした。
なのでここは間違えていないはずです。
See: https://github.com/redmine/redmine/blob/master/lib/redmine/search.rb#L130
from redmine_full_text_search.
Redmine側でソートするならそもそもreorder
しなくていいんじゃないかなぁと思いました。
from redmine_full_text_search.
limit
が10
で実際にヒットした件数が100件のときに違う結果が返ると思う。
このケースも問題ないということですか?
私は問題があると思うんですけどねぇ。
a = 100.times.collect {rand(100)}
# 100件レコードを生成
# => [18, 84, 77, 20, 62, 53, 12, 0, 88, 60, 72, 49, 40, 94, 34, 10, 22, 43, 14, 55, 90, 65, 61, 82, 41, 47, 16, 11, 8, 59, 60, 69, 80, 27, 98, 51, 31, 46, 23, 15, 0, 15, 14, 57, 16, 99, 83, 69, 8, 7, 38, 17, 71, 18, 17, 91, 61, 44, 60, 94, 60, 34, 91, 49, 29, 65, 38, 85, 81, 54, 87, 99, 1, 96, 56, 8, 72, 1, 37, 76, 91, 81, 78, 16, 32, 0, 31, 19, 86, 57, 58, 38, 14, 89, 72, 38, 79, 23, 35, 78]
a.sort[0..10]
# 100件のレコード全体でソートしてから先頭10件を取得
# => [0, 0, 0, 1, 1, 7, 8, 8, 8, 10, 11]
a[0..10].sort
# 10件のレコードを取得してからソート
# => [0, 12, 18, 20, 53, 60, 62, 72, 77, 84, 88]
# ↑の2つで結果が異なる
from redmine_full_text_search.
Redmine側でソートするならそもそもreorderしなくていいんじゃないかなぁと思いました。
SQL で limit 付いてるので reorder は必要です。
無いと返ってくる結果が一定になりません。
from redmine_full_text_search.
そもそも LIMIT 句付きのクエリが一切発行されてなかった。
なので、ヒットした全件を取得してから id の配列からソートしてる。。。
つまり reorder
も必要ないと言えば必要ない。たぶん元にした Redmine の実装で付いてたから付けてただけっぽい。
from redmine_full_text_search.
won't fix.
from redmine_full_text_search.
Related Issues (20)
- ActiveRecord::RecordNotFound (Couldn't find FullTextSearch::TagType with 'id'=0) HOT 3
- migrate error on pgroonga HOT 3
- インストールしようとするとデータベース(Mroonga)のマイグレーションに失敗する HOT 2
- redmine 5.0.2 ruby 3.1.2 HOT 3
- fts_targets records of custom field is not deleted when Issue is deleted HOT 2
- 削除したカスタムフィールドの単語を検索時、エラー HOT 5
- Thinking of OpenAI HOT 1
- データ同期でエラー HOT 11
- 検索結果のソートにチケット番号を追加してほしい HOT 42
- Redmine 5.1 isn't supported HOT 16
- Add support for fuzzy search
- Add test cases for order by last modified time or score HOT 1
- Support for Redmine master with Rails version 7 HOT 2
- Syntax error may be happen
- Asynchronous job for data update
- Search for "rms" results in a 500 error HOT 1
- Exceeds PostgreSQL index size limit HOT 4
- Error on Rails6 HOT 5
- Search Knowledgebase articles HOT 4
- Proposal to improve database recovery procedure HOT 3
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 redmine_full_text_search.