File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Search part of a word with Lucene?

 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I would like to know how to conf to get results if the search word is part of a word?

For example if I search cxwcxwc I get one result.
But if I search for cxwcxw (without the last c) I get no results even if cxwcxw is part of cxwcxwc.

Thanks.
[originally posted on jforum.net by Exo7]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There isn't support for willdcards currently.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just curious... do you know if Lucene can support "stemming"? For example, if a user enters "viewer" as the search term, a search engine that supports stemming will reduces the word to its root ("view") and returns all documents containing the root - like documents containing view, viewer, viewing, preview, review etc. Or conversely, if you enter view, it will expand the search with the alternates. (Giving weight to the preferred spelling).

Not a feature request, just wondering if it's a Lucene "freebie" that can be easily configured in.
[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not that hard to add a lot of useful Lucene search options to JForum - it's just a matter to adding it. It is possible to enhance the search form for some future release.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all your work and your answers Rafa´┐Żl!
[originally posted on jforum.net by Exo7]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wonder if anyone has been successful in integrating stemming. I tried by replacing the Lucene StandardAnalyzer with the SnowballAnalyzer (using the Lovins filter). I modified the LuceneManager and the LuceneSearch modules to reflect this new analyzer (both the indexer and the query parsing need to reflect the choice of Analyzer). For some reason, I can't seem to get it to work. When I search, no stemming appears to being performed - it acts just like the StandardAnalyzer. I thought perhaps the re-indexing was not reflecting the new Analyzer, so I created new posts to test, but to no avail. I have the feeling I'm missing something in the configuration of JForum...

Anyone else try this?
Thanks.
Carlos
[originally posted on jforum.net by cszamudio]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Update: I switched to the EnglishStemmer and that seemed to do the trick. Now wildcard and stemming work for searching the forums. Given that Lucene also support complex boolean expression, I also saw the need to add a new search filter that accepted a search expression (which I called filterByExpression), rather than use the filterByKeyword option.
[originally posted on jforum.net by cszamudio]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic