Checks if the specified token was already indexed. If yes, its PRE value is added to the existing values. Otherwise, a new index entry is created. @param token token to be indexed @param id ID value of the token @param pos pos value of the token @param index current file ID
(final byte[] token, final int id, final int pos, final int index)
| 39 | * @param index current file ID |
| 40 | */ |
| 41 | void add(final byte[] token, final int id, final int pos, final int index) { |
| 42 | final int os = keys.size(); |
| 43 | final int n = add(token, id, 0, index == 0); |
| 44 | if(os == keys.size()) { |
| 45 | final int i = index > 0 ? maps.get(Num.num(n)) : n; |
| 46 | if(poss.size() > i && poss.get(i) != null) { |
| 47 | poss.set(i, Num.add(poss.get(i), pos)); |
| 48 | numpre.set(i, numpre.get(i) + 1); |
| 49 | return; |
| 50 | } |
| 51 | } |
| 52 | poss.add(Num.newNum(pos)); |
| 53 | numpre.add(1); |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Initializes the tree for adding new full-text data. |