Reputation: 163
I have two different indexes - index1 and index2 In index1 I have documents which IDs match index2 (don't ask the reason it is done so, but the point is it is like this). So IDs amount and values must match in index1 and index2. Sometimes i have missing ID in one of the tables... so the question is: Is there any way to compare IDs of index1 and index2? For example i can count and amount of records in both indexes and if they mismatch can compare ID of each document in Index1 with ID in Index2 (check if it exists), but it will be really slow so I'm looking for the easier solution:)
Any idea will be appreciated!
Upvotes: 3
Views: 7835
Reputation: 61
I accomplished this by using the *
syntax
Upvotes: 0
Reputation: 11
One idea to find documents that are present in only one of the indexes could be to reindex both indices into a new third one and then search in that index for documents that have version > 1.
Upvotes: 1
Reputation: 508
I am struggling with this as well - you would think this would be easy. My thoughts are
Then you can filter on index2 for new items, or items found, and index1 can be filtered based on the FoundState for missing items
The extra work updating the items in the first index is a pain but the only way I can see in doing it
Upvotes: 0
Reputation: 2550
You could add a new bool field "in_index2" to index1 and count that bool field.
I don't like that solution, but it should be working.
Upvotes: 0