![]() ![]() You can use a constraint name in a string query with operators such as :, =. For information on search suggestions, see Search Term Completion.Ī constraint must have a name, and that name must be unique across all operators and constraints in your query options. For information on facets, see Constrained Searches and Faceted Navigation. To return information designed to be used in creating facets in an application.For information on search parsing and grammar, see The Default String Query Grammar. To provide a way to specify the constraint in a string query.Constraints are primarily used for the following purposes: For example, find a term only when it occurs in the value of a particular XML element or JSON property.Ĭonstraints are designed to take advantage of range indexes, lexicons, and fields that exist in the database, and the structures of documents in the database (for example, element values, attribute values, words, and so on). Set the $debug variable to true for development and false for production.Ī constraint is a mechanism the Search API and Client APIs use to limit the scope of a search. ![]() You can also set the debug option to true in a search:options node to return the output of search:check-options as part of your response.Ī common MarkLogic XQuery design pattern is to add a $debug option to your code that defaults to false, and when true, runs search:check-options or adds the debug option your query options. It is a good idea to only use query option validation in development, as it can slow down queries to check the options on every search. The Java API performs this check when you call .QueryOptionsManager.writeOptions. The REST API can perform an equivalent check when you persist query options through the /config/query service. If it finds errors, they are returned in the form of one or more search:report nodes. It returns empty if the options are valid. This function validates your options and reports any errors it finds. In XQuery, use the function search:check-options. The XQuery, REST and Java APIs include mechanisms for checking your query options for errors. Java: Searches performed using the .QueryManager class.REST: The /search, /values, /qbe services.XQuery: The functions search:search, search:resolve, search:values, and search:parse.Most search operations in the XQuery, REST and Java APIs accept optional query options, including the following: XML query options are always expressed as a search:options element in the following namespace: The REST and Java APIs also support a JSON representation. Query options can be specified in XML for all APIs. You can override the default options by defining custom query options and apply them to individual searches. You can modify the default query options if you are using the REST or Java API. MarkLogic Server defines a set of default query options that are applied when you do not include custom query options in a search. Query options enable you to control many aspects of content and values searches, including limiting the scope of a search, customizing the string search grammar, defining sort order, and specifying the contents and format of search results. Semaphore AI Technology Create and manage metadata and transform information into meaningful, actionable intelligence with Semaphore, our no-code metadata engine.A database, search engine, data integration tool, and more, all rolled into one. MarkLogic Server Unlock value from complex data and power new opportunities with MarkLogic Server.MarkLogic Data Platform Simplify your most complex data challenges, unlock value, and achieve data agility with the MarkLogic Data Platform.
0 Comments
Leave a Reply. |