You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2009/03/20 10:46:42 UTC

[jira] Created: (CAMEL-1472) Lucene Component

Lucene Component
----------------

                 Key: CAMEL-1472
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
             Project: Apache Camel
          Issue Type: New Feature
            Reporter: Claus Ibsen
             Fix For: 2.1.0


We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56672#action_56672 ] 

Ashwin Karpe edited comment on CAMEL-1472 at 12/28/09 3:19 PM:
---------------------------------------------------------------

Hi Claus,

It should definitely be possible to do that... The only question I have is philosophical as to whether it is ok to do so. The differences between components and processors is rather academic in that components represent endpoints and processors don't... Technically I do not see any reason why the Lucene component itself could not do more.

If you would like me to implement the Query Processor in this fashion I would be happy to do so. I would have preferred a DSL associated processor way, but givent that it requires changes in camel-core and creates unnecessary dependencies and bloat, I avoided this approach. In the absence of that the command on the URI is quite elegant. The Component now has to do a teeny bit more in dealing with the configuration.

Please let me know.

Cheers,

Ashwin... 

      was (Author: akarpe):
    Hi Claus,

It should definitely be possible to do that... The only question I have is philosophical as to whether it is ok to do so. The differences between components and processors is rather academic in that components represent endpoints and processors don't... Technically I do not see any reason why the Lucene component itself could not do more.

If you would like me to implement the Query Processor in this fashion I would be happy to do so. I would have preferred a DSL associated processor way, but givent that it requires changes in camel-core and creates unnecessary dependencies and bloat. Hence I avoided this approach. in the absence of that the command on the URI is quite elegant. The Component now has to do a teeny bit more in dealing with the configuration.

Please let me know.

Cheers,

Ashwin... 
  
> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashwin Karpe updated CAMEL-1472:
--------------------------------

    Attachment:     (was: camel-lucene20091231.zip)

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20100102.patch, camel-lucene-20100102.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56707#action_56707 ] 

Claus Ibsen commented on CAMEL-1472:
------------------------------------

Ashwin cool

One note about the option names. We generally do *not* use xxxRef anymore as we can do # lookup now.

So I propose to rename {{analyzerRef}} to {{analyzer}} and then let it be of type Analyzer or whatever Lucene object type its supposed to be. Then the getter/setter on the Endpoint is using rich types (e.g. not just plain String). Then if you use IoC or other stuff then you can inject those real types.

Did it make sense?

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene-20091231.patch, camel-lucene.zip, camel-lucene20091231.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56672#action_56672 ] 

Ashwin Karpe commented on CAMEL-1472:
-------------------------------------

Hi Claus,

It should definitely be possible to do that... The only question I have is philosophical as to whether it is ok to do so. The differences between components and processors is rather academic in that components represent endpoints and processors don't... Technically I do not see any reason why the Lucene component itself could not do more.

If you would like me to implement the Query Processor in this fashion I would be happy to do so. I would have preferred a DSL associated processor way, but givent that it requires changes in camel-core and creates unnecessary dependencies and bloat. Hence I avoided this approach. in the absence of that the command on the URI is quite elegant. The Component now has to do a teeny bit more in dealing with the configuration.

Please let me know.

Cheers,

Ashwin... 

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56673#action_56673 ] 

Hadrian Zbarcea commented on CAMEL-1472:
----------------------------------------

Ashwin,

Not at all. There is very clear semantic distinction between the components, endpoints, processors, producers, consumers and a few more core Camel concepts.. Components abstract one or a set of related technologies, such as protocols, languages, dataformats, etc. Endpoints represent abstractions of interaction points with a system that uses said technologies. Consumers are the entities that can accept messages using a protocol, and pass it down to a processor, Producers are entities that get a messages from some producers and pass them along to an (external) system using a protocol. The key artifact that binds all this together is the uri that allows you to: uniquely identify an endpoint, determine what component implements it and provides the configuration that determines endpoint behavior.

I like Claus' suggestion of uri {{"lucene:<action>:<config>"}}. It's clean and does not require any change in the core.

That said, another nice contribution! Many thanks and keep them coming.

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56699#action_56699 ] 

Ashwin Karpe commented on CAMEL-1472:
-------------------------------------

Hi Willem,

Thanks for the pointer. I will check it out. BTW, I am making good progress on this so I should be able to put a new package together in the next couple of days (if I can get the kids to behave that is :) )

Cheers,

Ashwin...

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashwin Karpe updated CAMEL-1472:
--------------------------------

    Attachment:     (was: camel-lucene.zip)

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20100102.patch, camel-lucene-20100102.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56815#action_56815 ] 

Ashwin Karpe commented on CAMEL-1472:
-------------------------------------

Hi Claus,

Sure thing. I will put ts together right away.

Cheers,

Ashwin...

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: 2.2.0
>
>         Attachments: camel-lucene-20100104.patch, camel-lucene-20100104.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56743#action_56743 ] 

Claus Ibsen commented on CAMEL-1472:
------------------------------------

Ashwin

*Having the following comments, in a bit of messy order as its type as I looked at the code:*
1) Why does JettyConfiguration have a LuceneComponent field? I would assume a xxConfiguration is a simple object that is like a getter/setter that can easily be configured in Spring XML but also can do some URL parsing as well. It should likely also have a default no-arg ctr so you can create it from spring XML more easily. Ah you should probably pass the Component in the {{parseURL}} method so you can use it locally only in this method and leave all the getter/setter for easy Spring XML config as well.
2) The code for parsing the authority could be a bit smarter, however we only have 2 operations so I assume it do. 
3) I dont like the default of the indexDir to be {{target/index}} which smells like a maven folder for unit testing
4) The getMaxHits code could be prettier, eg use that getAndRemoveParameter and then put it in settings afterards. Then you can use Camel Type convert to get it as a integer and avoid the ugly JDK converter and type case code
5) The operation parameter can be an enum and Camel can auto convert to it from a String (case insensitve AFAIR). Just a note.
6) No need to INFO log creating a producer. camel-core have logging for creating consumers/producers already. And INFO logging is to high and the logging info does not provide good details anyway. So please remove it.
7) LuceneEndpoint is preferred to have a default no arg ctr as well and have getter/setter to configure it so you can create that endpoint easily as well. There are some components which is not possible like that, eg Jetty, Http etc. But this one is simple enough for that.
8) Why is the endpoint *non singleton*? Most endpoints can be singleton out of the box
9) The debug loggin in LucenIndexer looks like TRACE logging to me. Try to mimimize DEBUG logging a bit and use TRACE for the very verbose stuff
10) I wonder if the body *cannot* be converted to String should the indexer skip the entire Exchange? Or should some exception be thrown. You can use getMandatoryBody if the body must exist.
11) LuceneProducer. Remove that INFO logging which has no value. camel-core has logging already for starting and stopping resource in Camel
12) I dont think you need to store endpoint in LuceneProducer as the super got it already
13) Dont use NPE exception but throw an IllegalArgumentException instead if some parameters or value is missing. 
14) LucenseSearcher again use TRACE logging for that kind of logging
15) Dont use IOConverter directly to just do a new File(folder) to avoid that hard dependency
16) LuceneQueryProcessor - Dont swallow exceptions and dont use e.printStrackTrace(). This error seems so severe that the exception should be rethrown
17) Remove code that is commented out
18) Why does the search return data as a XML String. Why not have some POJO class with the search result. And let end user marshal to XML if you *really* need XML. I am not keen on this. 



And use isXXXEnabled for those loggers to avoid overhead when that level is not enabled

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20100102.patch, camel-lucene-20100102.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56667#action_56667 ] 

Ashwin Karpe edited comment on CAMEL-1472 at 12/28/09 6:47 AM:
---------------------------------------------------------------

Hi Claus, Jon & Hadrian, 

I have created a new Apache Lucene Component & Query processor and have attached a patch along with a zip file containing the code for your review.  I have also added the requisite unit tests and ensured that the code undergoes checkstyle validation.

The component works as follows

Lucene Producer: Index Creation example
----------------------------------------------------------
       context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("direct:start").
                    to("lucene://stdQuotesIndex?analyzerRef=#stdAnalyzer&indexDir=#std&srcDir=#load_dir").
                    to("mock:result");

            }
        });

where each URI parameter setting does the following 
       - analyzerRef:  can be any valid implementation of Lucene Directory Analyzer (StandardAnalyzer, WhitespaceAnalyzer, StopAnalyzer... etc)
       - srcDir: an optional directory location for loading Text or XML documents at endpoint or Lucene Index creation.    

Since these settings cannot be directly passed into the URI, I pass them using the JNDI registry associated with the the Default Component (example shown below).  

Example: Providing values for the Lucene URI
--------------------------------------------------------------
    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = new JndiRegistry(createJndiContext());
        registry.bind("std", new File("target/stdindexDir"));
        registry.bind("load_dir", new File("src/test/resources/sources"));
        registry.bind("stdAnalyzer", new StandardAnalyzer(Version.LUCENE_CURRENT));
        return registry;
    }

I have also added a Query Processor that is fully capable of running any queries (including wildcards etc) against a Lucene Document Index and present the results in a schema driven XML format (example provided below)

Example:  Query Processor for Lucene called LuceneSearcher
-------------------------------------------------------------------------------------
       context.addRoutes(new RouteBuilder() {
            public void configure() {
                
                from("direct:start").
                    setHeader("QUERY", constant("Rodney Dangerfield")).
                    process(new LuceneSearcher("target/stdindexDir", analyzer, null, 20)).
                    to("mock:searchResult");
            }
        });  

Example: Search Results presentation Format
----------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<hits xmlns="http://camel.apache.org/lucene/SearchData">
      <numberOfHits>2</numberOfHits>
      <hit>
             <number>1</number>
             <hitLocation>15</hitLocation>
             <score>0.9453935</score>
             <data>I worked in a pet store and people kept asking how big I?d get. - Rodney Dangerfield</data>
      </hit>
      <hit>
              <number>2</number>
              <hitLocation>13</hitLocation>
              <score>0.8272193</score>
              <data>I tell ya when I was a kid, all I knew was rejection. My yo-yo, it never came back. - Rodney Dangerfield</data>
      </hit>
</hits>

I used the latest version of Lucene version 3.0 for the implementation but this can be moved up easily over time since I have no hard restrictions on Lucene versions. The API sets could be different moving backwards though. I have not verified this.... Lucene has undergone a lot of change in each subsequent version it seems :). The good news is that for the most part they offer backward compatibility for API's.

Please find attached the patch as well as a zip file containing the code.

Can you please review and please let me know what you think. I would be happy to update the documentation once I get your feedback and am happy to make any needed changes.

Cheers,

Ashwin...

      was (Author: akarpe):
    Hi Claus, Jon & Hadrian, 

I have created a new Apache Lucene Component & Query processor and have attached a patch along with a zip file containing the code for your review.  I have also added the requisite unit tests and ensured that the code undergoes checkstyle validation.

The component works as follows

<code>
       context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("direct:start").
                    to("lucene://stdQuotesIndex?analyzerRef=#stdAnalyzer&indexDir=#std&srcDir=#load_dir").
                    to("mock:result");

            }
        });
</code>

where each URI parameter setting does the following 
       - analyzerRef:  can be any valid implementation of Lucene Directory Analyzer (StandardAnalyzer, WhitespaceAnalyzer, StopAnalyzer... etc)
       - srcDir: an optional directory location for loading Text or XML documents at endpoint or Lucene Index creation.    

Since these settings cannot be directly passed into the URI, I pass them using the JNDI registry associated with the the Default Component (example shown below).  

<code>
    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = new JndiRegistry(createJndiContext());
        registry.bind("std", new File("target/stdindexDir"));
        registry.bind("load_dir", new File("src/test/resources/sources"));
        registry.bind("stdAnalyzer", new StandardAnalyzer(Version.LUCENE_CURRENT));
        return registry;
    }
</code>

I used the latest version of Lucene version 3.0 for the implementation but this can be moved up easily over time since I have no hard restrictions on Lucene versions. The API sets could be different moving backwards though. I have not verified this.... Lucene has undergone a lot of change in each subsequent version it seems :).

Please find attached the patch as well as a zip file containing the code.

Can you please review and please let me know what you think. I would be happy to update the documentation once I get your feedback and am happy to make any needed changes.

Cheers,

Ashwin...
  
> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-1472) Lucene Component

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56673#action_56673 ] 

Hadrian Zbarcea edited comment on CAMEL-1472 at 12/28/09 5:54 PM:
------------------------------------------------------------------

Ashwin,

Not at all. There is very clear semantic distinction between the components, endpoints, processors, producers, consumers and a few more core Camel concepts.. Components implement one or a set of related technologies, such as protocols, languages, dataformats, etc. Endpoints represent abstractions of interaction points with a system that uses said technologies. Consumers are the entities that can accept messages using a protocol, and pass it down to a processor, Producers are entities that get a messages from some producers and pass them along to an (external) system using a protocol. The key artifact that binds all this together is the uri that allows you to: uniquely identify an endpoint, determine what component implements it and provides the configuration that determines endpoint behavior.

I like Claus' suggestion of uri {{"lucene:<action>:<config>"}}. It's clean and does not require any change in the core.

That said, another nice contribution! Many thanks and keep them coming.

      was (Author: hadrian):
    Ashwin,

Not at all. There is very clear semantic distinction between the components, endpoints, processors, producers, consumers and a few more core Camel concepts.. Components abstract one or a set of related technologies, such as protocols, languages, dataformats, etc. Endpoints represent abstractions of interaction points with a system that uses said technologies. Consumers are the entities that can accept messages using a protocol, and pass it down to a processor, Producers are entities that get a messages from some producers and pass them along to an (external) system using a protocol. The key artifact that binds all this together is the uri that allows you to: uniquely identify an endpoint, determine what component implements it and provides the configuration that determines endpoint behavior.

I like Claus' suggestion of uri {{"lucene:<action>:<config>"}}. It's clean and does not require any change in the core.

That said, another nice contribution! Many thanks and keep them coming.
  
> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56740#action_56740 ] 

Ashwin Karpe commented on CAMEL-1472:
-------------------------------------

Hi Claus,

Can you please let me know what you think of the submission as it stands now.

Cheers,

Ashwin...

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20100102.patch, camel-lucene-20100102.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashwin Karpe updated CAMEL-1472:
--------------------------------

    Attachment: camel-lucene.zip
                camel-lucene-20091227.patch

Pls see attached zip files for your review

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashwin Karpe updated CAMEL-1472:
--------------------------------

    Attachment:     (was: camel-lucene-20100102.patch)

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20100104.patch, camel-lucene-20100104.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CAMEL-1472) Lucene Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-1472:
----------------------------------

    Assignee: Ashwin Karpe

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashwin Karpe updated CAMEL-1472:
--------------------------------

    Attachment: camel-lucene20091231.zip
                camel-lucene-20091231.patch

Hi Claus, Willem & Hadrian,

Please find attached an updated patch and zip file (20091231) containing the recommended changes 
      - Added a Producer with the ability to query Lucene using the URI convention
{code}
                from("direct:start").
                    setHeader("QUERY", constant("Seinfeld")).
                    to("lucene:searchIndex:query?analyzerRef=#whitespaceAnalyzer&indexDir=#whitespace&maxHits=20").
                    to("direct:next");
{code}
     - Modified the Producer to provide an ability to performs inserts using the URI convention
{code}
                from("direct:start").
                    to("lucene:stdQuotesIndex:insert?analyzerRef=#stdAnalyzer&indexDir=#std&srcDir=#load_dir").
                    to("mock:result");
{code}

I also changed the name of the Processor to search the Lucene Index from LuceneSearcher to LuceneQueryProcessor. The LuceneSearcher now is a more focused class for performing the search operation.

Please let me know if you have any questions or have further suggestions.

Cheers,

Ashwin...

P.S. Wish you all a happy new year (2010)...       

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene-20091231.patch, camel-lucene.zip, camel-lucene20091231.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashwin Karpe updated CAMEL-1472:
--------------------------------

    Attachment:     (was: camel-lucene-20091227.patch)

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20100102.patch, camel-lucene-20100102.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56726#action_56726 ] 

Ashwin Karpe edited comment on CAMEL-1472 at 1/3/10 4:42 AM:
-------------------------------------------------------------

Hi Claus ,

I have made the change you suggested and am attaching the patch and zip file with the code. I am also removing the earlier attachments.

If you need me to do something, please let me know. If you approve and would like me to add documentation to the wiki, I would be happy to do so.

Cheers,

Ashwin...


      was (Author: akarpe):
    Hi Claus ,

I have made the change you suggested nd a attaching the patch and zip file with the code. I am also removing the earlier attachments.

If you need me to do something, please let me know. If you approve and would like me to add documentation to the wiki, I would be happy to do so.

Cheers,

Ashwin...

  
> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20100102.patch, camel-lucene-20100102.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56675#action_56675 ] 

Ashwin Karpe commented on CAMEL-1472:
-------------------------------------

Hi Claus & Hadrian,

I agree with both the definitions and recommendations. I will go ahead and update the component to support both insert and query capability via the URI.

I will also as Claus suggested keep the processor around as well for users who would like to use the processor without directly referring to an endpoint.

Cheers,

Ashwin...

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56667#action_56667 ] 

Ashwin Karpe commented on CAMEL-1472:
-------------------------------------

Hi Claus, Jon & Hadrian, 

I have created a new Apache Lucene Component & Query processor and have attached a patch along with a zip file containing the code for your review.  I have also added the requisite unit tests and ensured that the code undergoes checkstyle validation.

The component works as follows

       context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("direct:start").
                    to("lucene://stdQuotesIndex?analyzerRef=#stdAnalyzer&indexDir=#std&srcDir=#load_dir").
                    to("mock:result");

            }
        });

where each URI parameter setting does the following 
       - analyzerRef:  can be any valid implementation of Lucene Directory Analyzer (StandardAnalyzer, WhitespaceAnalyzer, StopAnalyzer... etc)
       - srcDir: an optional directory location for loading Text or XML documents at endpoint or Lucene Index creation.    

Since these settings cannot be directly passed into the URI, I pass them using the JNDI registry associated with the the Default Component (example shown below).  

    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = new JndiRegistry(createJndiContext());
        registry.bind("std", new File("target/stdindexDir"));
        registry.bind("load_dir", new File("src/test/resources/sources"));
        registry.bind("stdAnalyzer", new StandardAnalyzer(Version.LUCENE_CURRENT));
        return registry;
    }

I used the latest version of Lucene version 3.0 for the implementation but this can be moved up easily over time since I have no hard restrictions on Lucene versions. The API sets could be different moving backwards though. I have not verified this.... Lucene has undergone a lot of change in each subsequent version it seems :).

Please find attached the patch as well as a zip file containing the code.

Can you please review and please let me know what you think. I would be happy to update the documentation once I get your feedback and am happy to make any needed changes.

Cheers,

Ashwin...

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1472) Lucene Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-1472:
-------------------------------

    Fix Version/s:     (was: 2.2.0)
                   Future

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>             Fix For: Future
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56667#action_56667 ] 

Ashwin Karpe edited comment on CAMEL-1472 at 12/28/09 6:32 AM:
---------------------------------------------------------------

Hi Claus, Jon & Hadrian, 

I have created a new Apache Lucene Component & Query processor and have attached a patch along with a zip file containing the code for your review.  I have also added the requisite unit tests and ensured that the code undergoes checkstyle validation.

The component works as follows

<code>
       context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("direct:start").
                    to("lucene://stdQuotesIndex?analyzerRef=#stdAnalyzer&indexDir=#std&srcDir=#load_dir").
                    to("mock:result");

            }
        });
</code>

where each URI parameter setting does the following 
       - analyzerRef:  can be any valid implementation of Lucene Directory Analyzer (StandardAnalyzer, WhitespaceAnalyzer, StopAnalyzer... etc)
       - srcDir: an optional directory location for loading Text or XML documents at endpoint or Lucene Index creation.    

Since these settings cannot be directly passed into the URI, I pass them using the JNDI registry associated with the the Default Component (example shown below).  

<code>
    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = new JndiRegistry(createJndiContext());
        registry.bind("std", new File("target/stdindexDir"));
        registry.bind("load_dir", new File("src/test/resources/sources"));
        registry.bind("stdAnalyzer", new StandardAnalyzer(Version.LUCENE_CURRENT));
        return registry;
    }
</code>

I used the latest version of Lucene version 3.0 for the implementation but this can be moved up easily over time since I have no hard restrictions on Lucene versions. The API sets could be different moving backwards though. I have not verified this.... Lucene has undergone a lot of change in each subsequent version it seems :).

Please find attached the patch as well as a zip file containing the code.

Can you please review and please let me know what you think. I would be happy to update the documentation once I get your feedback and am happy to make any needed changes.

Cheers,

Ashwin...

      was (Author: akarpe):
    Hi Claus, Jon & Hadrian, 

I have created a new Apache Lucene Component & Query processor and have attached a patch along with a zip file containing the code for your review.  I have also added the requisite unit tests and ensured that the code undergoes checkstyle validation.

The component works as follows

       context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("direct:start").
                    to("lucene://stdQuotesIndex?analyzerRef=#stdAnalyzer&indexDir=#std&srcDir=#load_dir").
                    to("mock:result");

            }
        });

where each URI parameter setting does the following 
       - analyzerRef:  can be any valid implementation of Lucene Directory Analyzer (StandardAnalyzer, WhitespaceAnalyzer, StopAnalyzer... etc)
       - srcDir: an optional directory location for loading Text or XML documents at endpoint or Lucene Index creation.    

Since these settings cannot be directly passed into the URI, I pass them using the JNDI registry associated with the the Default Component (example shown below).  

    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = new JndiRegistry(createJndiContext());
        registry.bind("std", new File("target/stdindexDir"));
        registry.bind("load_dir", new File("src/test/resources/sources"));
        registry.bind("stdAnalyzer", new StandardAnalyzer(Version.LUCENE_CURRENT));
        return registry;
    }

I used the latest version of Lucene version 3.0 for the implementation but this can be moved up easily over time since I have no hard restrictions on Lucene versions. The API sets could be different moving backwards though. I have not verified this.... Lucene has undergone a lot of change in each subsequent version it seems :).

Please find attached the patch as well as a zip file containing the code.

Can you please review and please let me know what you think. I would be happy to update the documentation once I get your feedback and am happy to make any needed changes.

Cheers,

Ashwin...
  
> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56748#action_56748 ] 

Claus Ibsen commented on CAMEL-1472:
------------------------------------

trunk: 895924.

Ashwin do you mind taking a stab at creating the wiki documentation?

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: 2.2.0
>
>         Attachments: camel-lucene-20100104.patch, camel-lucene-20100104.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56715#action_56715 ] 

Ashwin Karpe commented on CAMEL-1472:
-------------------------------------

Claus,

Sure, No worries. I will change the URI Query parameter to analyzer from analyzerRef and submit an updated patch/zip file.

- Ashwin...

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene-20091231.patch, camel-lucene.zip, camel-lucene20091231.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56667#action_56667 ] 

Ashwin Karpe edited comment on CAMEL-1472 at 12/28/09 6:57 AM:
---------------------------------------------------------------

Hi Claus, Jon & Hadrian, 

I have created a new Apache Lucene Component & Query processor and have attached a patch along with a zip file containing the code for your review.  I have also added the requisite unit tests and ensured that the code undergoes checkstyle validation.

The component works as follows

Lucene Producer: Index Creation example
----------------------------------------------------------
       context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("direct:start").
                    to("lucene://stdQuotesIndex?analyzerRef=#stdAnalyzer&indexDir=#std&srcDir=#load_dir").
                    to("mock:result");

            }
        });

where each URI parameter setting does the following 
       - analyzerRef:  can be any valid implementation of Lucene Directory Analyzer (StandardAnalyzer, WhitespaceAnalyzer, StopAnalyzer... etc)
       - srcDir: an optional directory location for loading Text or XML documents at endpoint or Lucene Index creation.    

Once created the index can take any exchange body and store its contents in the index.

Important Note: Lucene stipulates that the index be created upfront and then used in a read only mode later for any querying. Hence the index cannot be in flux during query processing. This requires the Lucene Producer to have received its payloads upfront and created the index before any queries can be logged against it.  

Since the URI settings cannot be directly passed, I pass them using the JNDI registry associated with the the Default Component (example shown below).  

Example: Providing values for the Lucene URI
--------------------------------------------------------------
    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = new JndiRegistry(createJndiContext());
        registry.bind("std", new File("target/stdindexDir"));
        registry.bind("load_dir", new File("src/test/resources/sources"));
        registry.bind("stdAnalyzer", new StandardAnalyzer(Version.LUCENE_CURRENT));
        return registry;
    }

I have also added a Query Processor that is fully capable of running any queries (including wildcards etc) against a Lucene Document Index and present the results in a schema driven XML format (example provided below)

Example:  Query Processor for Lucene called LuceneSearcher
-------------------------------------------------------------------------------------
       context.addRoutes(new RouteBuilder() {
            public void configure() {
                
                from("direct:start").
                    setHeader("QUERY", constant("Rodney Dangerfield")).
                    process(new LuceneSearcher("target/stdindexDir", analyzer, null, 20)).
                    to("mock:searchResult");
            }
        });  

Example: Search Results presentation Format
----------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<hits xmlns="http://camel.apache.org/lucene/SearchData">
      <numberOfHits>2</numberOfHits>
      <hit>
             <number>1</number>
             <hitLocation>15</hitLocation>
             <score>0.9453935</score>
             <data>I worked in a pet store and people kept asking how big I?d get. - Rodney Dangerfield</data>
      </hit>
      <hit>
              <number>2</number>
              <hitLocation>13</hitLocation>
              <score>0.8272193</score>
              <data>I tell ya when I was a kid, all I knew was rejection. My yo-yo, it never came back. - Rodney Dangerfield</data>
      </hit>
</hits>

I used the latest version of Lucene version 3.0 for the implementation but this can be moved up easily over time since I have no hard restrictions on Lucene versions. The API sets could be different moving backwards though. I have not verified this.... Lucene has undergone a lot of change in each subsequent version it seems :). The good news is that for the most part they offer backward compatibility for API's.

Please find attached the patch as well as a zip file containing the code.

Can you please review and please let me know what you think. I would be happy to update the documentation once I get your feedback and am happy to make any needed changes.

Cheers,

Ashwin...

      was (Author: akarpe):
    Hi Claus, Jon & Hadrian, 

I have created a new Apache Lucene Component & Query processor and have attached a patch along with a zip file containing the code for your review.  I have also added the requisite unit tests and ensured that the code undergoes checkstyle validation.

The component works as follows

Lucene Producer: Index Creation example
----------------------------------------------------------
       context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("direct:start").
                    to("lucene://stdQuotesIndex?analyzerRef=#stdAnalyzer&indexDir=#std&srcDir=#load_dir").
                    to("mock:result");

            }
        });

where each URI parameter setting does the following 
       - analyzerRef:  can be any valid implementation of Lucene Directory Analyzer (StandardAnalyzer, WhitespaceAnalyzer, StopAnalyzer... etc)
       - srcDir: an optional directory location for loading Text or XML documents at endpoint or Lucene Index creation.    

Since these settings cannot be directly passed into the URI, I pass them using the JNDI registry associated with the the Default Component (example shown below).  

Example: Providing values for the Lucene URI
--------------------------------------------------------------
    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = new JndiRegistry(createJndiContext());
        registry.bind("std", new File("target/stdindexDir"));
        registry.bind("load_dir", new File("src/test/resources/sources"));
        registry.bind("stdAnalyzer", new StandardAnalyzer(Version.LUCENE_CURRENT));
        return registry;
    }

I have also added a Query Processor that is fully capable of running any queries (including wildcards etc) against a Lucene Document Index and present the results in a schema driven XML format (example provided below)

Example:  Query Processor for Lucene called LuceneSearcher
-------------------------------------------------------------------------------------
       context.addRoutes(new RouteBuilder() {
            public void configure() {
                
                from("direct:start").
                    setHeader("QUERY", constant("Rodney Dangerfield")).
                    process(new LuceneSearcher("target/stdindexDir", analyzer, null, 20)).
                    to("mock:searchResult");
            }
        });  

Example: Search Results presentation Format
----------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<hits xmlns="http://camel.apache.org/lucene/SearchData">
      <numberOfHits>2</numberOfHits>
      <hit>
             <number>1</number>
             <hitLocation>15</hitLocation>
             <score>0.9453935</score>
             <data>I worked in a pet store and people kept asking how big I?d get. - Rodney Dangerfield</data>
      </hit>
      <hit>
              <number>2</number>
              <hitLocation>13</hitLocation>
              <score>0.8272193</score>
              <data>I tell ya when I was a kid, all I knew was rejection. My yo-yo, it never came back. - Rodney Dangerfield</data>
      </hit>
</hits>

I used the latest version of Lucene version 3.0 for the implementation but this can be moved up easily over time since I have no hard restrictions on Lucene versions. The API sets could be different moving backwards though. I have not verified this.... Lucene has undergone a lot of change in each subsequent version it seems :). The good news is that for the most part they offer backward compatibility for API's.

Please find attached the patch as well as a zip file containing the code.

Can you please review and please let me know what you think. I would be happy to update the documentation once I get your feedback and am happy to make any needed changes.

Cheers,

Ashwin...
  
> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-1472) Lucene Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-1472.
--------------------------------

    Resolution: Fixed

Thanks Ashwin

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: 2.2.0
>
>         Attachments: camel-lucene-20100104.patch, camel-lucene-20100104.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56715#action_56715 ] 

Ashwin Karpe edited comment on CAMEL-1472 at 12/31/09 12:59 PM:
----------------------------------------------------------------

Claus,

Sure, No worries. I will change the URI Query parameter to analyzer from analyzerRef.

Also to clarify, do you mean I should use component.lookup(...) instead of component.resolveAndRemoveReferenceParameter(...) and then pass the Analyzer as any other Spring injected bean that can be pulled using # lookup

Ashwin...

      was (Author: akarpe):
    Claus,

Sure, No worries. I will change the URI Query parameter to analyzer from analyzerRef and submit an updated patch/zip file.

- Ashwin...
  
> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene-20091231.patch, camel-lucene.zip, camel-lucene20091231.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashwin Karpe updated CAMEL-1472:
--------------------------------

    Attachment:     (was: camel-lucene-20100102.zip)

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20100104.patch, camel-lucene-20100104.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56671#action_56671 ] 

Claus Ibsen commented on CAMEL-1472:
------------------------------------

I wonder if its feasible to let the QueryProcessor be integrated into the component so you can use {{.to("lucene:XXXX")}} and have some options XXX to make it stand out that its a query and *not* insert.

We can even have a command on the uri, eg. {{"lucene:insert:xxx?yyy"}} or {{"lucene:query:xxx?yyy"}}

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56820#action_56820 ] 

Ashwin Karpe commented on CAMEL-1472:
-------------------------------------

Hi Claus,

I have created the wiki documentation for Lucene and added the link to the component list.

Cheers,

Ashwin... 



> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: 2.2.0
>
>         Attachments: camel-lucene-20100104.patch, camel-lucene-20100104.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1472) Lucene Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-1472:
-------------------------------

    Fix Version/s:     (was: Future)
                   2.2.0

Ashwin looks great. I will get it in 2.2.

I may have a few modifications such as letting the Hit classes be serializable and provide a toString on these classes so they can be easy logged etc.

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: 2.2.0
>
>         Attachments: camel-lucene-20100104.patch, camel-lucene-20100104.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56674#action_56674 ] 

Claus Ibsen commented on CAMEL-1472:
------------------------------------

Yeah wel said Hadrian.

The raw processors is a bit to low level and has a kind of ugly DSL smell to it.
Most other components offer most interaction with it through _endpoints_ so I think you should try making search part of this as well.

When that is said you can still keep the logic in a Processor when some end users can leverage without the need for an endpoint.
That allows you to use both worlds.

And also a kudo for me for working on yet another Camel component.

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56745#action_56745 ] 

Ashwin Karpe commented on CAMEL-1472:
-------------------------------------

Hi Claus,

I have made the needed changes and attached the new patch and zip files following modification and appropriate testing.

Please find the updates based on your suggestions

Cheers,

Ashwin...

===============================================
Having the following comments, in a bit of messy order as its type as I looked at the code:
1) Why does JettyConfiguration have a LuceneComponent field? I would assume a xxConfiguration is a simple object that is like a getter/setter that can easily be configured in Spring XML but also can do some URL parsing as well. It should likely also have a default no-arg ctr so you can create it from spring XML more easily. Ah you should probably pass the Component in the parseURL method so you can use it locally only in this method and leave all the getter/setter for easy Spring XML config as well.
Ashwin: Done

2) The code for parsing the authority could be a bit smarter, however we only have 2 operations so I assume it do. 
Ashwin: Done

3) I dont like the default of the indexDir to be target/index which smells like a maven folder for unit testing
Ashwin: Done. Changed target/index to ./indexDirectory

4) The getMaxHits code could be prettier, eg use that getAndRemoveParameter and then put it in settings afterards. Then you can use Camel Type convert to get it as a integer and avoid the ugly JDK converter and type case code
Ashwin: Was unclear on what to do here. Did not change.

5) The operation parameter can be an enum and Camel can auto convert to it from a String (case insensitve AFAIR). Just a note.
Ashwin: Was unclear on what to do here. Did not change.

6) No need to INFO log creating a producer. camel-core have logging for creating consumers/producers already. And INFO logging is to high and the logging info does not provide good details anyway. So please remove it.
Ashwin: Done

7) LuceneEndpoint is preferred to have a default no arg ctr as well and have getter/setter to configure it so you can create that endpoint easily as well. There are some components which is not possible like that, eg Jetty, Http etc. But this one is simple enough for that.
Ashwin: Done

8) Why is the endpoint non singleton? Most endpoints can be singleton out of the box
Ashwin: Done. Changed to singleton

9) The debug loggin in LucenIndexer looks like TRACE logging to me. Try to mimimize DEBUG logging a bit and use TRACE for the very verbose stuff
Ashwin: Done.

10) I wonder if the body cannot be converted to String should the indexer skip the entire Exchange? Or should some exception be thrown. You can use getMandatoryBody if the body must exist.
Ashwin: Done

11) LuceneProducer. Remove that INFO logging which has no value. camel-core has logging already for starting and stopping resource in Camel
Ashwin: Done

12) I dont think you need to store endpoint in LuceneProducer as the super got it already
Ashwin: Done

13) Dont use NPE exception but throw an IllegalArgumentException instead if some parameters or value is missing. 
Ashwin: Done

14) LucenseSearcher again use TRACE logging for that kind of logging
Ashwin: Done

15) Dont use IOConverter directly to just do a new File(folder) to avoid that hard dependency
Ashwin: Done

16) LuceneQueryProcessor - Dont swallow exceptions and dont use e.printStrackTrace(). This error seems so severe that the exception should be rethrown
Ashwin: Done

17) Remove code that is commented out
Ashwin: Done. Sorry about that. It slipped in :)

18) Why does the search return data as a XML String. Why not have some POJO class with the search result. And let end user marshal to XML if you really need XML. I am not keen on this. 
Ashwin: Done. Changed to data structure and removed the JAXB marshaller, schemas etc.

And use isXXXEnabled for those loggers to avoid overhead when that level is not enabled
Ashwin: Done
====================================================================


> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20100104.patch, camel-lucene-20100104.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-1472) Lucene Component

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56667#action_56667 ] 

Claus Ibsen edited comment on CAMEL-1472 at 12/28/09 2:33 PM:
--------------------------------------------------------------

Hi Claus, Jon & Hadrian, 

I have created a new Apache Lucene Component & Query processor and have attached a patch along with a zip file containing the code for your review.  I have also added the requisite unit tests and ensured that the code undergoes checkstyle validation.

The component works as follows

Lucene Producer: Index Creation example
----------------------------------------------------------
{code}
       context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("direct:start").
                    to("lucene://stdQuotesIndex?analyzerRef=#stdAnalyzer&indexDir=#std&srcDir=#load_dir").
                    to("mock:result");

            }
        });
{code}

where each URI parameter setting does the following 
       - analyzerRef:  can be any valid implementation of Lucene Directory Analyzer (StandardAnalyzer, WhitespaceAnalyzer, StopAnalyzer... etc)
       - srcDir: an optional directory location for loading Text or XML documents at endpoint or Lucene Index creation.    

Once created the index can take any exchange body and store its contents in the index.

Important Note: Lucene stipulates that the index be created upfront and then used in a read only mode later for any querying. Hence the index cannot be in flux during query processing. This requires the Lucene Producer to have received its payloads upfront and created the index before any queries can be logged against it.  

Since the URI settings cannot be directly passed, I pass them using the JNDI registry associated with the the Default Component (example shown below).  

Example: Providing values for the Lucene URI
--------------------------------------------------------------
{code}
    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = new JndiRegistry(createJndiContext());
        registry.bind("std", new File("target/stdindexDir"));
        registry.bind("load_dir", new File("src/test/resources/sources"));
        registry.bind("stdAnalyzer", new StandardAnalyzer(Version.LUCENE_CURRENT));
        return registry;
    }
{code}

I have also added a Query Processor that is fully capable of running any queries (including wildcards etc) against a Lucene Document Index and present the results in a schema driven XML format (example provided below)

Example:  Query Processor for Lucene called LuceneSearcher
-------------------------------------------------------------------------------------
{code}
       context.addRoutes(new RouteBuilder() {
            public void configure() {
                
                from("direct:start").
                    setHeader("QUERY", constant("Rodney Dangerfield")).
                    process(new LuceneSearcher("target/stdindexDir", analyzer, null, 20)).
                    to("mock:searchResult");
            }
        });  
{code}

Example: Search Results presentation Format
----------------------------------------------------------------
{code:xml}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<hits xmlns="http://camel.apache.org/lucene/SearchData">
      <numberOfHits>2</numberOfHits>
      <hit>
             <number>1</number>
             <hitLocation>15</hitLocation>
             <score>0.9453935</score>
             <data>I worked in a pet store and people kept asking how big I?d get. - Rodney Dangerfield</data>
      </hit>
      <hit>
              <number>2</number>
              <hitLocation>13</hitLocation>
              <score>0.8272193</score>
              <data>I tell ya when I was a kid, all I knew was rejection. My yo-yo, it never came back. - Rodney Dangerfield</data>
      </hit>
</hits>
{code}

I used the latest version of Lucene version 3.0 for the implementation but this can be moved up easily over time since I have no hard restrictions on Lucene versions. The API sets could be different moving backwards though. I have not verified this.... Lucene has undergone a lot of change in each subsequent version it seems :). The good news is that for the most part they offer backward compatibility for API's.

Please find attached the patch as well as a zip file containing the code.

Can you please review and please let me know what you think. I would be happy to update the documentation once I get your feedback and am happy to make any needed changes.

Cheers,

Ashwin...

edit: updated to use code snippets

      was (Author: akarpe):
    Hi Claus, Jon & Hadrian, 

I have created a new Apache Lucene Component & Query processor and have attached a patch along with a zip file containing the code for your review.  I have also added the requisite unit tests and ensured that the code undergoes checkstyle validation.

The component works as follows

Lucene Producer: Index Creation example
----------------------------------------------------------
       context.addRoutes(new RouteBuilder() {
            public void configure() {
                from("direct:start").
                    to("lucene://stdQuotesIndex?analyzerRef=#stdAnalyzer&indexDir=#std&srcDir=#load_dir").
                    to("mock:result");

            }
        });

where each URI parameter setting does the following 
       - analyzerRef:  can be any valid implementation of Lucene Directory Analyzer (StandardAnalyzer, WhitespaceAnalyzer, StopAnalyzer... etc)
       - srcDir: an optional directory location for loading Text or XML documents at endpoint or Lucene Index creation.    

Once created the index can take any exchange body and store its contents in the index.

Important Note: Lucene stipulates that the index be created upfront and then used in a read only mode later for any querying. Hence the index cannot be in flux during query processing. This requires the Lucene Producer to have received its payloads upfront and created the index before any queries can be logged against it.  

Since the URI settings cannot be directly passed, I pass them using the JNDI registry associated with the the Default Component (example shown below).  

Example: Providing values for the Lucene URI
--------------------------------------------------------------
    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = new JndiRegistry(createJndiContext());
        registry.bind("std", new File("target/stdindexDir"));
        registry.bind("load_dir", new File("src/test/resources/sources"));
        registry.bind("stdAnalyzer", new StandardAnalyzer(Version.LUCENE_CURRENT));
        return registry;
    }

I have also added a Query Processor that is fully capable of running any queries (including wildcards etc) against a Lucene Document Index and present the results in a schema driven XML format (example provided below)

Example:  Query Processor for Lucene called LuceneSearcher
-------------------------------------------------------------------------------------
       context.addRoutes(new RouteBuilder() {
            public void configure() {
                
                from("direct:start").
                    setHeader("QUERY", constant("Rodney Dangerfield")).
                    process(new LuceneSearcher("target/stdindexDir", analyzer, null, 20)).
                    to("mock:searchResult");
            }
        });  

Example: Search Results presentation Format
----------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<hits xmlns="http://camel.apache.org/lucene/SearchData">
      <numberOfHits>2</numberOfHits>
      <hit>
             <number>1</number>
             <hitLocation>15</hitLocation>
             <score>0.9453935</score>
             <data>I worked in a pet store and people kept asking how big I?d get. - Rodney Dangerfield</data>
      </hit>
      <hit>
              <number>2</number>
              <hitLocation>13</hitLocation>
              <score>0.8272193</score>
              <data>I tell ya when I was a kid, all I knew was rejection. My yo-yo, it never came back. - Rodney Dangerfield</data>
      </hit>
</hits>

I used the latest version of Lucene version 3.0 for the implementation but this can be moved up easily over time since I have no hard restrictions on Lucene versions. The API sets could be different moving backwards though. I have not verified this.... Lucene has undergone a lot of change in each subsequent version it seems :). The good news is that for the most part they offer backward compatibility for API's.

Please find attached the patch as well as a zip file containing the code.

Can you please review and please let me know what you think. I would be happy to update the documentation once I get your feedback and am happy to make any needed changes.

Cheers,

Ashwin...
  
> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashwin Karpe updated CAMEL-1472:
--------------------------------

    Attachment:     (was: camel-lucene-20091231.patch)

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20100102.patch, camel-lucene-20100102.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-1472) Lucene Component

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56694#action_56694 ] 

Willem Jiang commented on CAMEL-1472:
-------------------------------------

Hi Ashwin,

You may take the camel-jdbc component as an example, the camel-lucent component does the same thing :)

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56706#action_56706 ] 

Ashwin Karpe edited comment on CAMEL-1472 at 12/31/09 7:55 AM:
---------------------------------------------------------------

Hi Claus, Willem & Hadrian,

Please find attached an updated patch and zip file (20091231) containing the recommended changes 
      - Added a Producer with the ability to query Lucene using the URI convention
{code}
                from("direct:start").
                    setHeader("QUERY", constant("Seinfeld")).
                    to("lucene:MyIndex:query?analyzerRef=#whitespaceAnalyzer&indexDir=#whitespace&maxHits=20").
                    to("direct:next");
{code}
     - Modified the Producer to provide an ability to performs inserts using the URI convention
{code}
                from("direct:start").
                    to("lucene:MyIndex:insert?analyzerRef=#stdAnalyzer&indexDir=#std&srcDir=#load_dir").
                    to("mock:result");
{code}

I also changed the name of the Processor to search the Lucene Index from LuceneSearcher to LuceneQueryProcessor. The LuceneSearcher now is a more focused class for performing the search operation.

Please let me know if you have any questions or have further suggestions.

Cheers,

Ashwin...

P.S. Wish you all a happy new year (2010)...       

      was (Author: akarpe):
    Hi Claus, Willem & Hadrian,

Please find attached an updated patch and zip file (20091231) containing the recommended changes 
      - Added a Producer with the ability to query Lucene using the URI convention
{code}
                from("direct:start").
                    setHeader("QUERY", constant("Seinfeld")).
                    to("lucene:searchIndex:query?analyzerRef=#whitespaceAnalyzer&indexDir=#whitespace&maxHits=20").
                    to("direct:next");
{code}
     - Modified the Producer to provide an ability to performs inserts using the URI convention
{code}
                from("direct:start").
                    to("lucene:stdQuotesIndex:insert?analyzerRef=#stdAnalyzer&indexDir=#std&srcDir=#load_dir").
                    to("mock:result");
{code}

I also changed the name of the Processor to search the Lucene Index from LuceneSearcher to LuceneQueryProcessor. The LuceneSearcher now is a more focused class for performing the search operation.

Please let me know if you have any questions or have further suggestions.

Cheers,

Ashwin...

P.S. Wish you all a happy new year (2010)...       
  
> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene-20091231.patch, camel-lucene.zip, camel-lucene20091231.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56715#action_56715 ] 

Ashwin Karpe edited comment on CAMEL-1472 at 12/31/09 1:01 PM:
---------------------------------------------------------------

Claus,

Sure, No worries. I will change the URI Query parameter to analyzer from analyzerRef.

Also to clarify, do you mean I should use component.lookup(...) instead of component.resolveAndRemoveReferenceParameter(...) and then pass the Analyzer as any other Spring injected bean that can be pulled using # lookup

I will make the change, test and resubmit...

Ashwin...

      was (Author: akarpe):
    Claus,

Sure, No worries. I will change the URI Query parameter to analyzer from analyzerRef.

Also to clarify, do you mean I should use component.lookup(...) instead of component.resolveAndRemoveReferenceParameter(...) and then pass the Analyzer as any other Spring injected bean that can be pulled using # lookup

Ashwin...
  
> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20091227.patch, camel-lucene-20091231.patch, camel-lucene.zip, camel-lucene20091231.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashwin Karpe updated CAMEL-1472:
--------------------------------

    Attachment: camel-lucene-20100102.zip
                camel-lucene-20100102.patch

Hi Claus ,

I have made the change you suggested nd a attaching the patch and zip file with the code. I am also removing the earlier attachments.

If you need me to do something, please let me know. If you approve and would like me to add documentation to the wiki, I would be happy to do so.

Cheers,

Ashwin...


> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20100102.patch, camel-lucene-20100102.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-1472) Lucene Component

Posted by "Ashwin Karpe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashwin Karpe updated CAMEL-1472:
--------------------------------

    Attachment: camel-lucene-20100104.zip
                camel-lucene-20100104.patch

> Lucene Component
> ----------------
>
>                 Key: CAMEL-1472
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1472
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>             Fix For: Future
>
>         Attachments: camel-lucene-20100104.patch, camel-lucene-20100104.zip
>
>
> We should add a new component for Apache Lucene integration

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.