Click or drag to resize

IUserSessionLuceneQueryAllT, TIndex Method


Queries the content store using Lucene query syntax, returning a collection of objects of the given type.

The CSAPI creates indexes in the content store to expedite object lookup. The CSAPI comes with a set of indexes for its basic functionality. All strong-typed queries go through this method. Additional custom indexes can be created to provide further flexibility on fast lookup. Please refer to the Indexing topic for more information on indexes and custom indexes.


Namespace: Ingeniux.CMS
Assembly: Ingeniux.CMS.CSAPI (in Ingeniux.CMS.CSAPI.dll) Version: 10.6.492
Syntax
IEnumerable<T> LuceneQueryAll<T, TIndex>(
	string luceneQueryExpression,
	Action<int> stepFunc = null
)
where TIndex : new(), AbstractIndexCreationTask

Parameters

luceneQueryExpression  String

[Missing <param name="luceneQueryExpression"/> documentation for "M:Ingeniux.CMS.IUserSession.LuceneQueryAll``2(System.String,System.Action{System.Int32})"]

stepFunc  ActionInt32  (Optional)

[Missing <param name="stepFunc"/> documentation for "M:Ingeniux.CMS.IUserSession.LuceneQueryAll``2(System.String,System.Action{System.Int32})"]

Type Parameters

T
Type of objects to retrieve
TIndex
Type of the index class

Return Value

IEnumerableT
A collection of objects of the given type. Deferred execution.
Remarks

Because the execution of the query is deferred, additional queries can be applied to the result and be executed on content-store side. For the query to be executed on content-store side, additional queries cannot use any of the object's methods, only fields and direct properties. If content store side–execution is not required, you should first convet the result to an array using the "ToArray()" method.

Example

Lucene query syntax is fairly straightforward. Use the indexable property names and check if they contain the value.

For example, searching by name for a page that starts with the word "test" would look something like this:

C#
var pages = session.LuceneQuery<Page, PagesByHierarchy>(out c, "Name:test*");
See Also

Reference

IUserSession Interface
Ingeniux.CMS Namespace
QueryT, TIndex
LuceneQuery``2(String)
LuceneQuery``1(String)
LuceneQueryCountT, TIndex(String)

Other Resources

Indexing