1.9.30 sync.
[gae.git] / java / src / main / com / google / appengine / api / search / checkers / SearchApiLimits.java
blob15dae4167090aea42d7a0781940eb15c0cd953d0
1 package com.google.appengine.api.search.checkers;
3 import com.google.appengine.api.search.DateUtil;
5 import java.util.Date;
7 /**
8 * Contains limits on field values, document sizes, and other properties of objects in the Search
9 * API.
11 public class SearchApiLimits {
13 /**
14 * The pattern each document field name should match.
16 public static final String FIELD_NAME_PATTERN = "^[A-Za-z][A-Za-z0-9_]*$";
18 /**
19 * The default number of indexes we will try to return.
21 public static final int GET_INDEXES_DEFAULT_LIMIT = 20;
23 /**
24 * The maximum number of indexes that can be requested to be returned in
25 * list indexes results.
27 public static final int GET_INDEXES_MAXIMUM_LIMIT = 1000;
29 /**
30 * The maximum offset of the first index returned in list indexes results.
32 public static final int GET_INDEXES_MAXIMUM_OFFSET = 1000;
34 /**
35 * The default number of documents requested for get range requests.
37 public static final int GET_RANGE_DEFAULT_LIMIT = 100;
39 /**
40 * The maximum number of documents which can be requested for get range requests.
42 public static final int GET_RANGE_MAXIMUM_LIMIT = 1000;
44 /**
45 * The maximum length of an atom in bytes ({@value}).
47 public static final int MAXIMUM_ATOM_LENGTH = 500;
49 /**
50 * The maximum length of a prefix field in bytes ({@value}).
52 public static final int MAXIMUM_PREFIX_LENGTH = 500;
54 /**
55 * The maximum length of a cursor.
57 public static final int MAXIMUM_CURSOR_LENGTH = 10000;
59 /**
60 * The maximum date that can be stored in a date field.
62 public static final Date MAXIMUM_DATE_VALUE =
63 DateUtil.getEpochPlusDays(
64 Integer.MAX_VALUE, DateUtil.MILLISECONDS_IN_DAY - 1);
66 /**
67 * The maximum length of a document id.
69 public static final int MAXIMUM_DOCUMENT_ID_LENGTH = 500;
71 /**
72 * The maximum length of a document.
74 public static final int MAXIMUM_DOCUMENT_LENGTH = 1 << 20;
76 /**
77 * The maximum length for an index name.
79 public static final int MAXIMUM_INDEX_NAME_LENGTH = 100;
81 /**
82 * The maximum length of a field or facet name in bytes ({@value}).
84 public static final int MAXIMUM_NAME_LENGTH = 500;
86 /**
87 * The maximum negative degrees for latitude.
89 public static final double MAXIMUM_NEGATIVE_LATITUDE = -90.0;
91 /**
92 * The maximum negative degrees for longitude.
94 public static final double MAXIMUM_NEGATIVE_LONGITUDE = -180.0;
96 /**
97 * The maximum value that can be stored in a number field ({@value}).
99 public static final double MAXIMUM_NUMBER_VALUE = 2147483647;
102 * The maximum positive degrees for latitude.
104 public static final double MAXIMUM_POSITIVE_LATITUDE = 90.0;
107 * The maximum positive degrees for longitude.
109 public static final double MAXIMUM_POSITIVE_LONGITUDE = 180.0;
112 * The maximum length of a query string.
114 public static final int MAXIMUM_QUERY_LENGTH = 2000;
117 * The maximum length of a text or HTML in bytes ({@value}).
119 public static final int MAXIMUM_TEXT_LENGTH = 1024 * 1024;
122 * The minimum date that can be stored in a date field.
124 public static final Date MINIMUM_DATE_VALUE =
125 DateUtil.getEpochPlusDays(Integer.MIN_VALUE, 0);
128 * The minimum value that can be stored in a number field ({@value}).
130 public static final double MINIMUM_NUMBER_VALUE = -2147483647;
133 * The maximum number of documents allowed per index and delete request.
135 public static final int PUT_MAXIMUM_DOCS_PER_REQUEST = 200;
138 * The default limit on the number of documents to return in results.
140 public static final int SEARCH_DEFAULT_LIMIT = 20;
143 * The default found count accuracy is the limit.
145 public static final int SEARCH_DEFAULT_NUMBER_FOUND_ACCURACY = -1;
148 * The default number of documents to score.
150 public static final int SEARCH_DEFAULT_SORTED_LIMIT = 1000;
153 * The maximum number of documents that can be requested
154 * to be returned in search results.
156 public static final int SEARCH_MAXIMUM_LIMIT = 1000;
159 * The maximum number found accuracy that can be requested.
161 public static final int SEARCH_MAXIMUM_NUMBER_FOUND_ACCURACY = 25000;
164 * The maximum number of names of fields to return in results.
166 public static final int SEARCH_MAXIMUM_NUMBER_OF_FIELDS_TO_RETURN = 1000;
169 * The maximum offset into all search results to return results from.
171 public static final int SEARCH_MAXIMUM_OFFSET = 1000;
174 * The maximum number of documents that can be requested to be scored.
176 public static final int SEARCH_MAXIMUM_SORTED_LIMIT = 10000;
179 * The maximum number of facet discoveries that can be requested.
181 public static final int FACET_MAXIMUM_DISCOVERY_LIMIT = 100;
184 * The default value for number of discovered facets.
186 public static final int FACET_DEFAULT_DISCOVERY_LIMIT = 10;
189 * The maximum number for facet depth option.
191 public static final int FACET_MAXIMUM_DEPTH = 10000;
194 * The maximum value for facet value limit option.
196 public static final int FACET_MAXIMUM_VALUE_LIMIT = 20;
199 * The maximum number of facet value constraint can be requested.
201 public static final int FACET_MAXIMUM_CONSTRAINTS = 50;
204 * The maximum number of facet ranges can be requested.
206 public static final int FACET_MAXIMUM_RANGES = 50;
209 * This class cannot be instantiated.
211 private SearchApiLimits() {