The query translator would take a term query targetting the special class field and convert it into a query using the name as given through the user's strategy. Do you see any general issue stopping us from doing so?
I don't see any specific issue, just pointing out that you'd need to store the type field both within _meta and also somewhere else to make it possible to filter on the type. If the goal of this proposal is to make the JSON Document smaller, as the JIRA description suggests, then the size benefit is moot as we'd actually be adding the type twice. I could me mistaken on what the goal is though, some clarification would help. BTW in some cases the backend will need to add this restriction; see for example org.hibernate.search.backend.impl.lucene.works.DeleteWorkExecutor... not sure if the "query translator" is the right level to implement this. |