Andrey, Yes, it will find that element wherever it exists in XML documents in the database. All XML structure is always indexed in MarkLogic at the document level, so the indexes can tell MarkLogic Server which documents contain ns1:item at all. To find every element within those documents, each document that matches will be retrieved and scanned through to find the matches.
Adding indexes in MarkLogic is somewhat different from adding indexes in other systems because there are these two kinds of indexes: the Universal Index which is always on, and Range Indexes (a form of lexicon) which is explicitly defined per element. Range indexes are usually for fast sorting, facets and other operations beyond normal searching, so you can search for XML structures, words and the like without any special index settings and it will be quite fast. Note that searching for every value in a database can return huge amounts of data, however, so you may need to use another technique to limit the results. Yours, Damon -- Damon Feldman MarkLogic Corporation www.marklogic.com -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Ganyushkin, Andrey - Moscow Sent: Monday, September 23, 2013 3:54 AM To: MarkLogic Developer Discussion Subject: [MarkLogic Dev General] full search or not Hi All, If I use the following expression //ns1:item It's mean that ML scan all items (all tags and sub tags) in the my DB or not? and if I put ns1:item in DB index, could this speed up the query? Please explain it to me. Thanks, Andrey _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
