collectiveaccess / providence

Cataloguing and data/media management application
GNU General Public License v3.0
295 stars 167 forks source link

QuickSearch can show same record twice #1512

Open Monica-Wood opened 11 months ago

Monica-Wood commented 11 months ago

Sometimes a quicksearch can show the same record twice. Such as searching on a surname, showing the same entity record twice.

I have done a reindex and checked the database indexing entries. A snippet of the term being searched (in this case 'Allen'):

mysql> select * from ca_sql_search_word_index where word_id = 1689;
+----------+-----------+--------+-----------------+-----------+--------------------+--------------+-------------+---------+-------+--------+
| index_id | table_num | row_id | field_table_num | field_num | field_container_id | field_row_id | rel_type_id | word_id | boost | access |
+----------+-----------+--------+-----------------+-----------+--------------------+--------------+-------------+---------+-------+--------+
|    17204 |        20 |     29 |              25 | I8        |               NULL |           33 |           0 |    1689 |   100 |      0 |
|    17206 |        20 |     29 |              25 | I4        |               NULL |           33 |           0 |    1689 |   100 |      0 |
|    17323 |        20 |     30 |              25 | I8        |               NULL |           34 |           0 |    1689 |   100 |      0 |
|    17327 |        20 |     30 |              25 | I4        |               NULL |           34 |           0 |    1689 |   100 |      0 |
|    61684 |        20 |    480 |              25 | I8        |               NULL |          560 |           0 |    1689 |   100 |      0 |
|    61686 |        20 |    480 |              25 | I4        |               NULL |          560 |           0 |    1689 |   100 |      0 |
|    65199 |        20 |    520 |              25 | I8        |               NULL |          603 |           0 |    1689 |   100 |      0 |
|    65201 |        20 |    520 |              25 | I4        |               NULL |          603 |           0 |    1689 |   100 |      0 |

It is Entity ID 29 that is showing twice, but the others aren't. I can't see anything different about them.

collectiveaccess commented 11 months ago

The fields are different in those repeated entries - that's normal. How are you sorting the results? There's an issue in 1.8 with secondary sorts (sorts on multiple fields) that can cause duplicated results. It's high on the todo list to resolve.

Monica-Wood commented 11 months ago

The fields are also different in 30, 480 and 520 and they don't show twice. This is only on Quicksearch results, if the full results are clicked, it only shows it once.

collectiveaccess commented 11 months ago

Exactly. It doesn't have to do with indexing. It's probably the secondary sort issue I mentioned.

Monica-Wood commented 11 months ago

Ok, I see. I'll go and see if I can change the default sort order on quick search results. Thanks

collectiveaccess commented 11 months ago

That's just a work around. I'll let you know when we have the underlying issue resolved.