[ 
https://issues.apache.org/jira/browse/ISIS-383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Haywood updated ISIS-383:
-----------------------------
    Description: 
Isis is most often used with its JDO integration, a fairly conventional ORM.  
Searching for existing domain objects therefore requires a query to be defined. 
 But sometimes users want to just search for any object (like searching the 
web).  This ticket is to integrate Isis so that its domain objects can be 
indexed by Lucene and thus provide a generic search capability.

As of 1.10.0 this could be implemented using a subscriber:

{code}
@DomainService(nature=DOMAIN)
public class LuceneSubscriber extends AbstractSubscriber {
    @Subscribe public void on(ObjectPersistingEvent ev) { ... }
    @Subscribe public void on(ObjectUpdatingEvent ev) { ... }
    @Subscribe public void on(ObjectRemovingEvent ev) { ... }
}
{code}

Then one would also provide some sort of repository to query the Lucene 
datastore:

{code}
@DomainService(nature=DOMAIN)
public class LuceneRepository {
    @Action(semantics=SAFE)
    List<Object> find(String text) { ... }
}
{code}


There is also an attachment to this ticket, based on an earlier spike by 
Maurizio.  Note that that was done before the subscribers were available.

  was:
Isis is most often used with its JDO integration, a fairly conventional ORM.  
Searching for existing domain objects therefore requires a query to be defined.

But sometimes users want to just search for any object (like searching the 
web).  This ticket is to integrate Isis so that its domain objects can be 
indexed by Lucene and thus provide a generic search capability.

One way to get hold of the text (to be indexed) might be to use the existing 
capability to convert all objects into JSON (by the 
isis-restfulobjects-rendering module). 

It is also pretty easy to hook into Isis' objectstore to know when an object is 
being updated (to sync with Lucene's indexes).

~~~
But... I don't think this is a full summer's work though


> Integrate Apache Lucene or ElasticSearch (nb: recommend this is an isisaddon 
> rather than built-in)
> --------------------------------------------------------------------------------------------------
>
>                 Key: ISIS-383
>                 URL: https://issues.apache.org/jira/browse/ISIS-383
>             Project: Isis
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: core-1.1.0
>            Reporter: Dan Haywood
>             Fix For: 1.12.0
>
>         Attachments: isis-lucene.zip
>
>
> Isis is most often used with its JDO integration, a fairly conventional ORM.  
> Searching for existing domain objects therefore requires a query to be 
> defined.  But sometimes users want to just search for any object (like 
> searching the web).  This ticket is to integrate Isis so that its domain 
> objects can be indexed by Lucene and thus provide a generic search capability.
> As of 1.10.0 this could be implemented using a subscriber:
> {code}
> @DomainService(nature=DOMAIN)
> public class LuceneSubscriber extends AbstractSubscriber {
>     @Subscribe public void on(ObjectPersistingEvent ev) { ... }
>     @Subscribe public void on(ObjectUpdatingEvent ev) { ... }
>     @Subscribe public void on(ObjectRemovingEvent ev) { ... }
> }
> {code}
> Then one would also provide some sort of repository to query the Lucene 
> datastore:
> {code}
> @DomainService(nature=DOMAIN)
> public class LuceneRepository {
>     @Action(semantics=SAFE)
>     List<Object> find(String text) { ... }
> }
> {code}
> There is also an attachment to this ticket, based on an earlier spike by 
> Maurizio.  Note that that was done before the subscribers were available.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to