This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JForum and the fly likes Search part of a word with Lucene? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "Search part of a word with Lucene?" Watch "Search part of a word with Lucene?" New topic
Author

Search part of a word with Lucene?

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
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

Joined: Apr 22, 2012
Posts: 17424
There isn't support for willdcards currently.

Rafael
[originally posted on jforum.net by Rafael Steil]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
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

Joined: Apr 22, 2012
Posts: 17424
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

Joined: Apr 22, 2012
Posts: 17424
Thanks for all your work and your answers Rafa´┐Żl!
[originally posted on jforum.net by Exo7]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
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

Joined: Apr 22, 2012
Posts: 17424
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
 
subject: Search part of a word with Lucene?
 
Similar Threads
Reseting an Iterator
Amazon text search
search problem ..
Collections Framework
Random URL and Redirection