• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

how to search?

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am trying to make a search page in JSP.
I am able to search, with full text.

For example in my database I have different question titles.
  • Jsp failed to execute in Netbeans
  • UrlEncode the String
  • <c:set> jstl

  • when I enter the full title, the search is successful.

    Now if anyone could please tell me, how to make a search without entering the whole title.
    For example,
    if I enter "JSP failed to execute" I could get the search result.

    Thanks
     
    Bartender
    Posts: 6663
    5
    MyEclipse IDE Firefox Browser Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Are you querying the database to get the result ? In that case an expensive wildcard like %your_text_here% will do the trick. But it is not ideal.

    Using an API like lucene to perform searches on an full text index will provide better results.

    PS: What does this have to do with JSP ?
     
    Sheriff
    Posts: 67753
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Nothing to do with JSP. Moved to the JDBC forum.
     
    Bartender
    Posts: 1210
    25
    Android Python PHP C++ Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Malik,

    MySQL and PostgreSql provide fairly competent text search support through SQL statements, that are more efficient and accurate than LIKE operator.
    Typically, the only changes required in existing applications are:
    - Create appropriate DB indexes.
    - Modify SQL queries sent by application

    While PostgreSql provides tsquery and tssupport SQL operators, MySql provides the MATCH...AGAINST SQL clause.

    Between these two, PostgreSql's support is more powerful and feature rich than MySql. MySql unfortunately imposes a lot of conditions to support text search ( the worst of which is that storage engine for table being searched has to be non-transactional MyISAM). Neither is as powerful and accurate as a dedicated search framework like lucene/solr, but then maybe you don't need that level of accuracy.

    Another option, if you're using Hibernate or can integrate it, is the Hibernate Search addon. It integrates Lucene transparently with DB updates, which means your app design doesn't have to change much (other than adding some annotations and modifying Hibernate queries).
     
    Greenhorn
    Posts: 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    hi am rosary
    am java beginner i want to creat search engine in java is there an idea?
     
    Karthik Shiraly
    Bartender
    Posts: 1210
    25
    Android Python PHP C++ Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Rosary Albert wrote:hi am rosary
    am java beginner i want to creat search engine in java is there an idea?



    Hi Rosary, you'll have to provide more details about what you want the search engine to do and what data it should search.
     
    malik ge
    Ranch Hand
    Posts: 69
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks for reply.

    I think I ma gonna go with "Deepak Bala".
    I have been able to search with

    Now I want to know how to search it through Java?
    I have tried using it like this:


    but it did not work...
    any help?
     
    Sheriff
    Posts: 28371
    99
    Eclipse IDE Firefox Browser MySQL Database
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
     
    malik ge
    Ranch Hand
    Posts: 69
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    "Paul Clapham" thanks alot...
     
    And will you succeed? Yes you will indeed! (98 and 3/4 % guaranteed) - Seuss. tiny ad:
    Smokeless wood heat with a rocket mass heater
    https://woodheat.net
    reply
      Bookmark Topic Watch Topic
    • New Topic