Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle domain in same package contains same field #47

Open
xqliu opened this issue Jun 24, 2020 · 5 comments
Open

Handle domain in same package contains same field #47

xqliu opened this issue Jun 24, 2020 · 5 comments

Comments

@xqliu
Copy link

xqliu commented Jun 24, 2020

Hi,

When there's two domain defined in same package, which all contains field with same value like

class DummyDomain1 {
  String label
}

class DummyDomain2 {
  String label
}

Then the system will failed to start with follow exception, could you please advice which settings could be used to fix this issue? thanks.

I have tried to use alias with no luch.

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-06-25 07:07:20.349 ERROR [  restartedMain] org.springframework.boot.SpringApplication@reportFailure@823 : Application run failed

java.lang.IllegalArgumentException: Mapper for [label] conflicts with existing mapping in other types:
[mapper [label] is used by multiple types. Set update_all_types to true to update [boost] across all types.]
        at org.elasticsearch.index.mapper.FieldTypeLookup.checkCompatibility(FieldTypeLookup.java:130)
        at org.elasticsearch.index.mapper.FieldTypeLookup.copyAndAddAll(FieldTypeLookup.java:94)
        at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:400)
        at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:336)
        at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:260)
        at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$1.execute(MetaDataCreateIndexService.java:371)
        at org.elasticsearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:45)
        at org.elasticsearch.cluster.service.ClusterService.executeTasks(ClusterService.java:634)
        at org.elasticsearch.cluster.service.ClusterService.calculateTaskOutputs(ClusterService.java:612)
        at org.elasticsearch.cluster.service.ClusterService.runTasks(ClusterService.java:571)
        at org.elasticsearch.cluster.service.ClusterService$ClusterServiceTaskBatcher.run(ClusterService.java:263)
        at org.elasticsearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:150)
        at org.elasticsearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:188)
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:569)
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:247)
        at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:210)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

Handle domain in same package contains same field

@xqliu
Copy link
Author

xqliu commented Jun 24, 2020

Could you please help to merge this PR to resolve the above issue?

Thanks.

@puneetbehl
Copy link

@xqliu Which version of the plugin are you using? Could you please try with 2.7.0.RC1?

@xqliu
Copy link
Author

xqliu commented Jun 25, 2020

I am using 3.0.0 build snapshot

Seems the issue will happen if the field has different boost set.

While it does not happen If boost set to same value in different domain.

I have just workaround the issue by setting boost to same value

Since I am using grails 4, looks like the 2.7 does not work with grails 4.

Thanks for your work on this.

@puneetbehl
Copy link

There are some changes I need to do before releasing the one to support Grails 4. I would soon work on updating the master branch with changes from 2.7 and release a milestone version.

@puneetbehl puneetbehl added this to the 3.0.0 milestone Jun 26, 2020
@xqliu
Copy link
Author

xqliu commented Jun 28, 2020

Great, appreciate for your work on this plugin :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants