Skip to content

Find Duplicates Command (OLAP)

JoeWinter edited this page Sep 18, 2014 · 1 revision

[Table of Contents](https://github.com/dell-oss/Doradus/wiki/OLAP Databases: Table-of-Contents) | Previous | Next
OLAP REST Commands: Find Duplicates Command


An object with a given ID can be added to the same table in multiple shards. This is necessary for each shard to be a self-contained graph. But sometimes an application needs to determine which shards have objects with the same ID for a given table. The Find Duplicates command is optimized for this use case has the following form:

GET /{application}/{table}/_duplicates[?{params}]

where {application} is the application name and {table} is the name of the table to search. The optional {params} define which shards are searched:

  • shards=shards: A comma-separated list of shard names. Either this or the range parameter can be specified, but not both.

  • range=shard-from[,shard-to]: A starting shard name and optional ending shard name. All shards whose name falls between the given shard names (inclusive) are searched. If an ending shard name is not given all shards whose name is greater than or equal to the starting shard name are searched.

Either the shards or range parameter can be specified, but not both. If neither parameter is specified, all shards are searched. The result of the query is a results element containing a totalobjects value and a docs group, which contains one doc element for each object that was found in 2 or more shards. Below is an example:

<results>
	<totalobjects>3</totalobjects>
	<docs>
		<doc>
			<field name="_ID">kUNaqNJ2ymmb07jHY9OPOw==</field>
			<field name="shards">2014-01-01,2014-01-02</field>
		</doc>
	</docs>
</results>
Clone this wiki locally