Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 32CEF200BAD for ; Tue, 25 Oct 2016 19:57:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3158F160AD8; Tue, 25 Oct 2016 17:57:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 258C5160AF3 for ; Tue, 25 Oct 2016 19:57:10 +0200 (CEST) Received: (qmail 39783 invoked by uid 500); 25 Oct 2016 17:57:10 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 39774 invoked by uid 99); 25 Oct 2016 17:57:10 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Oct 2016 17:57:10 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 7F3E5C0D64 for ; Tue, 25 Oct 2016 17:57:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 35I8m3mQg33C for ; Tue, 25 Oct 2016 17:57:07 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 18ABC5F1BE for ; Tue, 25 Oct 2016 17:57:07 +0000 (UTC) Received: (qmail 81727 invoked by uid 99); 25 Oct 2016 16:57:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Oct 2016 16:57:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 23B3EE0556; Tue, 25 Oct 2016 16:57:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: dbarnes@apache.org To: commits@geode.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-geode git commit: GEODE-2023: Add Lucene documentation Date: Tue, 25 Oct 2016 16:57:06 +0000 (UTC) archived-at: Tue, 25 Oct 2016 17:57:12 -0000 Repository: incubator-geode Updated Branches: refs/heads/develop 15a54656f -> b0d12050c GEODE-2023: Add Lucene documentation Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/b0d12050 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/b0d12050 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/b0d12050 Branch: refs/heads/develop Commit: b0d12050cf7f88f4e2bfc4d7187a8a10a12a27f7 Parents: 15a5465 Author: Dave Barnes Authored: Fri Oct 21 14:44:37 2016 -0700 Committer: Dave Barnes Committed: Tue Oct 25 09:56:31 2016 -0700 ---------------------------------------------------------------------- .../source/subnavs/geode-subnav.erb | 14 ++ geode-docs/tools_modules/book_intro.html.md.erb | 13 +- .../lucene_integration.html.md.erb | 136 +++++++++++++++++++ 3 files changed, 158 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b0d12050/geode-book/master_middleman/source/subnavs/geode-subnav.erb ---------------------------------------------------------------------- diff --git a/geode-book/master_middleman/source/subnavs/geode-subnav.erb b/geode-book/master_middleman/source/subnavs/geode-subnav.erb index 30ff2f9..d0eb74e 100644 --- a/geode-book/master_middleman/source/subnavs/geode-subnav.erb +++ b/geode-book/master_middleman/source/subnavs/geode-subnav.erb @@ -2343,6 +2343,20 @@ limitations under the License. +
  • + Apache Lucene Integration + +
  • http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b0d12050/geode-docs/tools_modules/book_intro.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/tools_modules/book_intro.html.md.erb b/geode-docs/tools_modules/book_intro.html.md.erb index 852e3c9..a6db1d2 100644 --- a/geode-docs/tools_modules/book_intro.html.md.erb +++ b/geode-docs/tools_modules/book_intro.html.md.erb @@ -23,25 +23,28 @@ limitations under the License. -- **[gfsh (Geode SHell)](../tools_modules/gfsh/chapter_overview.html)** +- **[gfsh (Geode SHell)](gfsh/chapter_overview.html)** Geode gfsh (pronounced "jee-fish") provides a single, powerful command-line interface from which you can launch, manage, and monitor Geode processes, data, and applications. -- **[Gemcached](../tools_modules/gemcached/chapter_overview.html)** +- **[Gemcached](gemcached/chapter_overview.html)** Gemcached is a Geode adapter that allows Memcached clients to communicate with a Geode server cluster, as if the servers were memcached servers. Memcached is an open-source caching solution that uses a distributed, in-memory hash map to store key-value pairs of string or object data. -- **[HTTP Session Management Modules](../tools_modules/http_session_mgmt/chapter_overview.html)** +- **[HTTP Session Management Modules](http_session_mgmt/chapter_overview.html)** The Apache Geode HTTP Session Management modules provide fast, scalable, and reliable session replication for HTTP servers without requiring application changes. -- **[Geode Pulse](../tools_modules/pulse/chapter_overview.html)** +- **[Geode Pulse](pulse/chapter_overview.html)** Geode Pulse is a Web Application that provides a graphical dashboard for monitoring vital, real-time health and performance of Geode clusters, members, and regions. -- **[Geode Redis Adapter](../tools_modules/redis_adapter.html)** +- **[Geode Redis Adapter](redis_adapter.html)** The Geode Redis adapter allows Geode to function as a drop-in replacement for a Redis data store, letting Redis applications take advantage of Geode’s scaling capabilities without changing their client code. Redis clients connect to a Geode server in the same way they connect to a Redis server, using an IP address and a port number. +- **[Apache Lucene® Integration](lucene_integration.html)** + + The Apache Lucene® integration enables users to create Lucene indexes and execute Lucene searches on data stored in Geode. http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b0d12050/geode-docs/tools_modules/lucene_integration.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/tools_modules/lucene_integration.html.md.erb b/geode-docs/tools_modules/lucene_integration.html.md.erb new file mode 100644 index 0000000..6361650 --- /dev/null +++ b/geode-docs/tools_modules/lucene_integration.html.md.erb @@ -0,0 +1,136 @@ +--- +title: Apache Lucene® Integration +--- + + + + +Apache Lucene® is a widely-used Java full-text search engine. This section describes how the system integrates with Apache Lucene. +We assume that the reader is familiar with Apache Lucene's indexing and search functionalities. + +The Apache Lucene integration: + +- enables users to create Lucene indexes on data stored in Geode +- provides high availability of indexes using Geode's HA capabilities to store the indexes in memory +- optionally stores indexes on disk +- updates the indexes asynchronously to minimize impacting write latency +- provides scalability by partitioning index data +- colocates indexes with data + +For more details, see Javadocs for the classes and interfaces that implement Apache Lucene indexes and searches, including +`LuceneService`, `LuceneQueryFactory`, `LuceneQuery`, and `LuceneResultStruct`. + +## Using the Apache Lucene Integration + +You can create Apache Lucene indexes through a Java API, through the `gfsh` command-line utility, or by means of +the `cache.xml` configuration file. + +To use Apache Lucene Integration, you will need two pieces of information: + +1. The name of the region to be indexed or searched +2. The names of the fields you wish to index + + +### Key Points ### + +- Only top level fields of objects stored in the region can be indexed. +- Apache Lucene indexes are supported only on Partitioned regions. +- A single index supports a single region. Indexes do not support multiple regions. +- Heterogeneous objects in single region are supported. +- Join queries between regions are not supported. +- Nested objects are not supported. +- The index needs to be created before the region is created. + +## Java API Example + +``` pre +// Get LuceneService +LuceneService luceneService = LuceneServiceProvider.get(cache); + +// Create Index on fields with default analyzer: +luceneService.createIndex(indexName, regionName, "field1", "field2", "field3"); + +Region region = cache.createRegionFactory(RegionShutcut.PARTITION).create(regionName); + +``` + +## Search Example + +``` pre +LuceneQuery query = luceneService.createLuceneQueryFactory() + .setResultLimit(10) + .create(indexName, regionName, "Main Street", "address"); + +Collection results = query.findValues(); +``` + + +## Gfsh API + +The gfsh command-line utility supports four Apache Lucene actions: + +
    create lucene index
    +
    Create a lucene index that can be used to execute queries.
    +
    describe lucene index
    +
    Display the describe of lucene indexes created for all members.
    +
    list lucene indexes [with-stats]
    +
    Display the list of lucene indexes created for all members. The optional `with-stats` qualifier shows activity on the indexes.
    +
    search lucene
    +
    Search lucene index
    + +**Gfsh command-line examples:** + +``` pre +// List Index +gfsh> list lucene indexes [with-stats] + +// Create Index +gfsh>create lucene index --name=indexName --region=/orders --field=customer,tags + +// Create Index, specifying a custom analyzer for the second field +// Note: "null" in the first analyzer position means "use the default analyzer for the first field" +gfsh>create lucene index --name=indexName --region=/orders --field=customer,tags --analyzer=null,org.apache.lucene.analysis.bg.BulgarianAnalyzer + +// Execute Lucene query +gfsh> lucene search --regionName=/orders -queryStrings="John*" --defaultField=field1 --limit=100 +``` + + +## XML Configuration + +``` pre + + + + + + + + + + +``` +