<p dir="auto">Currently multifield mapping support path parameter per property so if you need to have several fields mapped for a property they will either all have full path name or just_name</p>
<p dir="auto">it is rather inconvenient when you want to have the property with say two secondary fields one with full name (because it only makes sense as a variant of primary field say not analyzed) and one with just_name because you want to have an all-like field to which many of your properties contribute.</p>
<p dir="auto">consider an example (a part of a bigger json)</p>
<p dir="auto">"category": {"code":"CTZ", "description":"My Description"}</p>
<p dir="auto">code was indexed as multifield resulting in names<br>
category.code<br>
category.code.untouched</p>
<p dir="auto">later I want to have my_all field to where I want to index category.code as well as other fields</p>
<p dir="auto">I will add path:"just_name" to my mapping and another field my_all</p>
<p dir="auto">that will immediately break my application because untouched will become a just_name mapping as well and all untouched from all my data elements will be rolled into it</p>
<p dir="auto">My current workaround is to provide full name for untouched field (category.code.untouched) so it retains its full name. I am not sure it is intentional behavior but it seems to work (need to test it more)</p>
<p dir="auto">But much cleaner approach would be to allow path per field in multifield mapping</p>
<p dir="auto">Hi,</p>
<p dir="auto">I have indexed documents that have a duplicate field. During the search I want to display only the document that has the highest score among its duplicate class (the group of documents that have the same field value).</p>
<p dir="auto">There has been a discussion about deduplication in Lucene mailing-list:<br>
<a href="http://www.mail-archive.com/java-user@lucene.apache.org/msg21437.html" rel="nofollow">http://www.mail-archive.com/java-user@lucene.apache.org/msg21437.html</a></p>
<p dir="auto">Would it be possible to implement the Duplicate filter which is in contrib:<br>
<a href="https://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/contrib/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java" rel="nofollow">https://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/contrib/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java</a></p>
<p dir="auto">So the request would look like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
    &quot;query&quot;: {
        &quot;term&quot;: { &quot;name&quot;: &quot;alexis&quot; }
    },
    &quot;filter&quot;: {
         &quot;duplicate&quot;: { &quot;field&quot;: &quot;name&quot; }
    }
}"><pre class="notranslate"><code class="notranslate">{
    "query": {
        "term": { "name": "alexis" }
    },
    "filter": {
         "duplicate": { "field": "name" }
    }
}
</code></pre></div>
<p dir="auto">Let me know if that makes sense...</p>