Changes

Jump to navigation Jump to search
1,843 bytes added ,  12:56, 11 November 2017
no edit summary
This page is linked from the [[Getting Started]] Section.
The options listed on this page influence the way how database [[Commands|commands]] are executed and XQuery expressions are evaluated. Options are divided into [[#Global Options|'''global options''']], which are valid for all BaseX instances, and '''local options''', which are specific to a client or session. Values Two kinds of options are either ''strings'', ''numbers'' or ''booleans''.exist:
The {{Code|.basex}} * '''[[Configuration#Configuration FilesGlobal Options|configuration fileGlobal Options]] ''' are valid for all BaseX instances in the same JVM. This is parsed by every new local BaseX instanceparticularly relevant if you are working with the client/server architecture. It contains * '''Local options''' (all global options and, optionally, local options at the end of the fileremaining ones) are specific to a client or session.
Values of options are either ''strings'', ''numbers'' or ''booleans''. Options are ''static'' and not bound to a single operation (for example, the next command). Various ways exist to access and change options:
* The current value of an option can be requested with the {{Command|GET}} command. Local options can be changed via {{Command|SET}}. All values are ''static'': They stay valid until they are (all global options, except for {{Option|DEBUG}}, can only be changed once again by another operationat startup time). If an option is of type ''boolean'', and if no value is specified, its current value will be inverted. * The {{Code|.basex}} [[Configuration#Configuration Files|configuration file]] is parsed by every new local BaseX instance. It contains all global options. Local options can be specified at the end of the file after the {{Code|Local Options}} comment: <pre class="brush:perl"># General OptionsDEBUG = false... # Local OptionsCHOP = false</pre>
* Initial values for global options can also be specified via system properties, which can e.g. be passed on with the [http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/java.html#options -D flag] on command line, or using [http://docs.oracle.com/javase/6/docs/api/java/lang/System.html#setProperty(java.lang.String,%20java.lang.String) System.setProperty()] before creating a BaseX instance. The specified keys need to be prefixed with {{Code|org.basex.}}. An example:
</pre>
* In XQuery, local options can be set via option declarations and pragmas (see [[XQuery Extensions#Pragmas|pragmas]]).
If options are changed by operations in the [[GUI]], the underlying commands will be listed in the [[GUI#Visualizations|Info View]].<br/><br/>
===FAIRLOCK===
 
{{Mark|Introduced with Version 8.6:}}
{| width='100%'
|-
| '''Summary'''
|Denotes the maximum allowed number of parallel [[Transaction Management|transactions]]:* If {{Option|FAIRLOCK}} is enabled, the number of parallel transactions will never exceed the specified value.<br/>Note * If the option is disabled (which is the default), the limit only applies to transactions that a access databases.* The main reason for allowing parallel operations is to prevent slow transactions from blocking all other operations. A higher number of parallel operations may increase disk activity and thus slow down queries. In some cases, a single transaction may even give you better results than any parallel activity. The main reason for allowing parallel operations is to prevent slow transactions from blocking all other operations.
|}
==HTTP Services==
If BaseX is run as web servlet, the Most HTTP options must be specified are defined in the {{Code|jetty.xml}} and {{Code|web.xml}} configuration files in the <code>[https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/webapp/WEB-INF webapp/WEB-INF]</code> directory and . Some additional BaseX-specific options exist that will be set before the {{Code|jetty.xml}} and {{Code|web.xml}} configuration files.server is started:
===WEBPATH===
===PARSERESTXQ===
 
{{Mark|Introduced with Version 8.6}}: replacing {{Code|CACHERESTXQ}}.
{| width='100%'
|-
| '''Summary'''
|If this option is turned on, new databases will be exclusively created in main memory. :* Most queries will be evaluated faster in main -memory mode, but all data is lost if the BaseX instance in which the database was created is shut down. The value of this option * It is not possible to store binary resources in a main-memory database.* A main-memory database will be assigned once have no disk representation. However, it is possible to export the database via the {{Command|EXPORT}} command, and create a new databasefrom the exported file in a second step.* This option will not be available for [[Database Module#db:create|db:create]], and cannot because the database would not be changed accessible anymore after thatdatabase creation, i. e., outside the query scope.
|}
|-
| '''Summary'''
|Defines a [[Parsers|parser]] for importing new files to the database. Currently, 'Available parsers are {{Code|XML'}}, '{{Code|JSON'}}, '{{Code|CSV'}}, '{{Code|TEXT'}}, 'and {{Code|HTML' are available as parsers}}. HTML will be parsed as normal XML files if [[Parsers#HTML_Parser|Tagsoup]] is not found in the classpath.
|}
|-
| '''Summary'''
|Specifies the way how HTML data will be parsed. Keys and values are delimited with <code>=</code>, and multiple options are delimited with <code>,</code>. The available options are described in the [[Parsers#Options|Parsers]] article.
|-
| '''Examples'''
|* <code>encoding=Shift-JIS,nons=true</code> parses the input as Sihft-JIS and suppresses namespaces.* <code>lexical=true</code> preserves comments.
|}
* The flag should be turned off if a document contains [[Full-Text#Mixed Content|mixed content]].
* The flag can also be turned off on [[Command-Line Options#BaseX Standalone|command line]] via <code>-w</code>.
* If the <code>xml:space="preserve"</code> attribute is attached to an element, chopping will be turned off for all descendant text nodes.  In the following example document, the whitespaces in the text nodes of the {{Code|text}} element will not be chopped:
<pre class="brush:xml">
<xml>
</xml>
</pre>
It is recommendable to additionally assign <code>indent=no</code> to the {{Option|SERIALIZER}} option; otherwise the serialized documents will automatically be indented.
|}
|This option affects the [[Indexes#Performance|construction]] of new value indexes. It controls the number of index build operations that are performed before writing partial index data to disk:
* The larger the assigned value is, the less splits will take place, and the more main memory will be required.
* By default, if the value is set to {{Code|0}}, some heuristics are applied, based on the current memory consumption. Usually, this works fine. If explicit garbage collection is disabled when running Java (e.g. via the JVM option {{Code|-XX:+DisableExplicitGC}}), you may need to choose a custom split size.
|}
|-
| '''Summary'''
|This option controls inlining of XQuery functions:* The XQuery compiler inlines functions to speed up query evaluation. * Inlining will only take place if a function body is not too large (i.e., if it does not contain too many expressions). * With this option, this maximum number of expressions can be specified.<br/>* Function inlining can be turned off by setting the value to {{Code|0}}. * The limit can be locally overridden overwritten via the [[XQuery Extensions#basex:inline|%basex:inline]] annotation (follow the documentation of this annotation will also give you some link to get more information on function inlining).
|}
| '''Summary'''
|Specifies how often a query will be evaluated. The result is serialized only once, and the measured times are averages of all runs. This option can also be changed on [[Command-Line Options#BaseX Standalone|command line]] via <code>-r</code>.
|}
 
===ENFORCEINDEX===
 
{{Mark|Introduced with Version 9.0}}:
 
{| width='100%'
|-
| width='120' | '''Signature'''
|{{Code|ENFORCEINDEX [boolean]}}
|-
| '''Default'''
|{{Code|false}}
|-
| '''Summary'''
|Enforces index rewritings in path expressions (see [[Indexes#Enforce Rewritings|Enforce Rewritings]] for details).
|}
| '''Examples'''
|
* <code>indent=no</code> : disables indentation of XML nodes (by default, this is enabled)
* <code>encoding=US-ASCII,omit-xml-declaration=no</code> : sets the encoding to {{Code|US-ASCII}} and prints the XML declaration.
* <code>item-separator=,,</code> : separates serialized items by a single comma.
=Changelog=
 
;Version 9.0
* Added: {{Option|ENFORCEINDEX}}
;Version 8.6
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu