Giter VIP home page Giter VIP logo

Comments (7)

kou avatar kou commented on May 29, 2024

あと、現状のreorderidが抜けていると思う。

from redmine_full_text_search.

okkez avatar okkez commented on May 29, 2024

ここで reorder しても、最後に Redmine 側で sort! するようになっているのでした。
なのでここは間違えていないはずです。

See: https://github.com/redmine/redmine/blob/master/lib/redmine/search.rb#L130

from redmine_full_text_search.

kou avatar kou commented on May 29, 2024

Redmine側でソートするならそもそもreorderしなくていいんじゃないかなぁと思いました。

from redmine_full_text_search.

kou avatar kou commented on May 29, 2024

limit10で実際にヒットした件数が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.

okkez avatar okkez commented on May 29, 2024

Redmine側でソートするならそもそもreorderしなくていいんじゃないかなぁと思いました。

SQL で limit 付いてるので reorder は必要です。
無いと返ってくる結果が一定になりません。

from redmine_full_text_search.

okkez avatar okkez commented on May 29, 2024

そもそも LIMIT 句付きのクエリが一切発行されてなかった。
なので、ヒットした全件を取得してから id の配列からソートしてる。。。
つまり reorder も必要ないと言えば必要ない。たぶん元にした Redmine の実装で付いてたから付けてただけっぽい。

from redmine_full_text_search.

okkez avatar okkez commented on May 29, 2024

won't fix.

from redmine_full_text_search.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.