| 1 |
module Groonga |
| 2 |
class IndexColumn |
| 3 |
private :estimate_size_for_term_id |
| 4 |
private :estimate_size_for_query |
| 5 |
private :estimate_size_for_lexicon_cursor |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
def estimate_size(term: nil, |
| 23 |
term_id: nil, |
| 24 |
query: nil, |
| 25 |
mode: nil, |
| 26 |
lexicon_cursor: nil) |
| 27 |
if term |
| 28 |
|
| 29 |
return estimate_size_for_term_id(term.id) |
| 30 |
end |
| 31 |
|
| 32 |
if term_id |
| 33 |
return estimate_size_for_term_id(term_id) |
| 34 |
end |
| 35 |
|
| 36 |
if query |
| 37 |
return estimate_size_for_query(query, mode: mode) |
| 38 |
end |
| 39 |
|
| 40 |
if lexicon_cursor |
| 41 |
return estimate_size_for_lexicon_cursor(lexicon_cursor) |
| 42 |
end |
| 43 |
|
| 44 |
message = "must specify :term_id, :term_id, :query or :lexicon_cursor" |
| 45 |
raise InvalidArgument, message |
| 46 |
end |
| 47 |
end |
| 48 |
end |