Results 1 to 4 of 4
  1. #1
    semoche is offline Member
    Join Date
    Nov 2009
    Posts
    7
    Rep Power
    0

    Default simple search engine

    i'm working on a simple search engine, which should be able to search for a word or phrase in my database. and bring out related topics. my problem is that i can search for a word but that of a phrase or sentence does not work. i tried using the split() in java then pass it to an array so i find by each word but a finder methods parameter can not be of type array. can anyone help me with a solution

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,120
    Rep Power
    20

    Default

    "...but a finder methods parameter can not be of type array."

    What does that mean?

    And some code to give us an idea of what you're actually doing might help (don't forget the code tags).

  3. #3
    semoche is offline Member
    Join Date
    Nov 2009
    Posts
    7
    Rep Power
    0

    Default

    in the code below.the 'findbyparts' cannot accept an array as the parameter. i want to be able to break up a phrase into each word in the sentence and search my DB word by word. thanks

    public ArrayList viewbyParts(String problem) {
    //TODO implement viewbyParts
    Collection col=null;
    String WILDCARD = "%";
    String []s=null;
    Iterator i=null;
    ArrayList list=new ArrayList();
    EngineLocal el=null;
    try{s = problem.split(" ");
    col=elh.findByParts(problem);

    for (int j=0; j<s.length; j++){
    System.out.println("The parts are "+s[j]);
    }
    i=col.iterator();
    while(i.hasNext()){
    el=(EngineLocal)i.next();
    list.add(new searchHelper(el.getSno(),el.getProblems()));
    }
    }catch(Exception e){
    e.getMessage();
    }
    return list;
    }

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,120
    Rep Power
    20

    Default

    Not knowing what findByParts does, or what it is expecting, I can't really help can I?
    I don't even know what class it's a part of, but looking at the code I'm guessing it's some non-Sun API. So my first question would be, why not rewrite findByParts?

    And you forgot the code tags...

Similar Threads

  1. Search Engine , Web Crawler
    By sahil.ansari in forum Advanced Java
    Replies: 5
    Last Post: 07-21-2008, 02:53 AM
  2. Braindumps Search Engine | http://exams.googletoad.com
    By sates52 in forum Reviews / Advertising
    Replies: 1
    Last Post: 05-03-2008, 04:21 PM
  3. Java Code Snippets Search Engine
    By ZuudoTech in forum Reviews / Advertising
    Replies: 1
    Last Post: 01-18-2008, 10:13 PM
  4. Search Engine
    By SSam Varghese in forum Java Servlet
    Replies: 5
    Last Post: 01-05-2008, 09:26 AM
  5. New Search engine for Java Programmers
    By coolgeek in forum Java Software
    Replies: 0
    Last Post: 07-02-2007, 08:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •