<div>Dear all,<br clear="all"></div><div><br></div><div>I&#39;ve been using the &#39;keywords&#39; notion of creating indexes on a MagmaCollection. I create keywords in which some of them have the same prefix: for instance the keywords can contain: user story 1, user story 2, user story 3, and so forth.  (which all donate the same object to be found)</div>

<div><br></div><div>If I then do a query on these keywords using:</div><div><br></div><div>magmacollection where: [:eachProductBacklog|         <br>                              eachProductBacklog keywords includesAllPrefixes: aString substrings] <br>

</div><div><br></div><div>and try to find &#39;user&#39; as aString, then the object is returned multiple times, which is something I do not expect. </div><div><br></div><div>If I look at (part of) the implementation of includesAllPrefixes: </div>

<div><br></div><div>expression addTerm: (self copy <br>                                                            from: eachString<br>                                                            to: eachString maAlphabeticalNext)<br></div><div><br></div><div>I can understand why multiple results are returned. Magma loops over its keys from &#39;user&#39; till &#39;user&#39; maAlphabeticalNext, and hash key for user story 1 , 2 and 3 match, so that result is returned 3 times.</div>

<div><br></div><div>The easiest way to make them unique is to send the distinct message. Is this something that always should be done? The docu on the wiki only mentions to send the distinct keyword if I use an or clause in the query? Of course the includesAllPrefixes: keywords is a sort of &#39;or&#39;.</div>

<div>Are there any other ways to make this work (since distinct is slow) ?</div><div><br></div><div>Thanks for any advice,</div><div><br></div><div>Kind Regards,</div><div><br>Bart</div><br>-- <br>imagination is more important than knowledge - Albert Einstein<br>

Logic will get you from A to B. Imagination will take you everywhere - Albert Einstein<br>Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning. - Albert Einstein<br>The true sign of intelligence is not knowledge but imagination. - Albert Einstein<br>

However beautiful the strategy, you should occasionally look at the results. - Sir Winston Churchill<br>It&#39;s not enough that we do our best; sometimes we have to do what&#39;s required. - Sir Winston Churchill<br>