Data model
This section details the three data models used by P4 Search.
Every data model document has a unique Elasticsearch document ID (_id) in the format <type>-<depotFile>#<rev> except for the ChangeModel, which uses the format <type>-<changeNumber> for its ID.
For example, for an AssetModel document, the ID might be asset-//depot/dam/Music Loops/License.txt#1
You can perform a document look-up on Elasticsearch as follows:
GET http://localhost:9200/index-perforce1-000001/_doc/asset-%2f%2fdepot%2fmain%2fp4-perl%2fP4.pm%2329
ChangeModel
One instance of the ChangeModel represents a single change in the P4 Server. The following attributes are stored in Elasticsearch:
Name | Description | Type |
---|---|---|
type |
Fixed string "change" |
String |
change |
P4 Server change number |
Long |
|
Change date |
Long |
client |
P4 Server client name |
String |
|
P4 Server user |
String |
|
Whether the change is restricted or not |
Boolean |
|
Change description |
String |
|
Depot file path |
String |
ContentModel
One instance of the ContentModel represents the contents of a single changed file in the P4 Server. The following attributes are stored in Elasticsearch:
Name | Description | Type |
---|---|---|
|
Fixed string "content" |
String |
|
Depot file path |
String |
|
P4 Server revision number |
Integer |
|
P4 Server change number |
Long |
|
Change date |
Long |
|
File name |
String |
fileSize |
File size in bytes |
Long |
|
File type, for example: text, binary, symlink, unicode, utf8, utf16. For more information on file types, see File Types in the P4 CLI Reference |
String |
|
P4 Server action, for example: add and edit |
String |
|
User that submitted the change |
String |
|
Content type detected by the Tika library |
String |
The content of the file indexed by the Tika library. Includes handwriting or any other text |
String |
AssetModel
One instance of the AssetModel represents a P4 DAM asset in the P4 Server. The following attributes are stored in Elasticsearch:
Name | Description | Type |
---|---|---|
type |
Fixed string "asset" |
String |
depotFile |
Depot file path |
String |
rev |
P4 Server revision number |
Integer |
change |
P4 Server change number |
Long |
date |
Change date |
Long |
fileName |
File name |
String |
fileSize |
File size in bytes |
Long |
digest | MD5sSum of content | String |
fileType |
File type |
String |
action |
P4 Server action, for example: add and edit |
String |
user |
User that submitted the change |
String |
blur |
The BlurHash for the image |
String |
blurSize | Blur pixel dimensions based on thumbnail/preview | String |
|
Auto-detected image tags. For <TagModel>, see TagModel |
List<TagModel> |
|
List of 'key' and 'value' pair of tags |
List<AttributeModel> |
customAttributes |
Array of 'uuid' and 'value' pairs |
JsonArray |
contentType |
Content type detected by the Tika library |
String |
metadata |
Metadata found by the Tika library, for example: EXIF metadata and more |
Map<String, String> |
gps |
GpsModel data extracted from EXIF metadata. See GpsModel |
GpsModel |
TagModel
One instance of the TagModel represents a single instance of an auto-detected tag on a file in the P4 Server. The following attributes are stored in Elasticsearch:
Name | Description | Type |
---|---|---|
|
Tag name |
String |
|
Confidence of detection (floating-point value from 0 to 1, where 1 represents 100%) |
Float |
|
Optional: 1 or more x, y points locating the tag within the image. Stored as a floating-point value from top-left (0, 0) to bottom-right (1, 1) |
List<Point2D.Float> |
GpsModel
To view example queries for EXIF data, see EXIF query examples .
One instance of the GpsModel represents one GPS location of a file's content in the P4 Server. The following attributes are stored in Elasticsearch:
Name | Description | Type |
---|---|---|
location |
Elasticsearch compatible location. See Location |
Location |
altitude |
Altitude in meters |
Double |
bearing |
Bearing in degrees from the north |
Double |
Location
One instance of the Location represents one Longitude/Latitude location. The following attributes are stored in Elasticsearch:
Name | Description | Type |
---|---|---|
lat |
Latitude in decimal |
Double |
lon |
Longitude in decimal |
Double |
(Deprecated) RevisionModel
One instance of the RevisionModel represents a single revision of a file in the P4 Server. The following attributes are stored in Elasticsearch:
Name | Description | Type |
---|---|---|
|
Fixed string "revision" |
String |
|
P4 Server change number |
Long |
|
Change date |
Long |
|
Depot file path |
String |
|
P4 Server action, for example: add and edit |
String |
|
File type, for example: text, binary, symlink, unicode, utf8, utf16. For more information on file types, see File Types in the P4 CLI Reference |
String |
|
P4 Server revision number |
Integer |
fileName |
File name |
String |
|
File size in bytes |
Long |
|
An MD5 digest of the file represented by a 32 hexadecimal digit string |
String |
|
User that submitted the change |
String |