Results 1 to 7 of 7

Thread: Keyword search

  1. #1
    jasmine2081 is offline Member
    Join Date
    Apr 2012
    Posts
    3
    Rep Power
    0

    Default Keyword search

    Hi ,

    When i give my item no:8415-00-051-1173 in search bar it displays item details of that particular product.

    But i need to get same results when i give without hypens i.e 8415000511173 .

    Can anyone guide me to get this result

    Thanks,
    Jasmine

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default Re: Keyword search

    How is your data stored?
    How do you do your search?
    Please do not ask for code as refusal often offends.

  3. #3
    jasmine2081 is offline Member
    Join Date
    Apr 2012
    Posts
    3
    Rep Power
    0

    Default Re: Keyword search

    It is stored as VARCHAR2.

    We have a search bar

    Keyword search-search.jpg

    I have attached my web page ,where i do search for a partno in the search bar.

    Do you have any idea ,how can we determine whether a partno consists of a hyphen.

    For ex.

    if(partNum.consistsOf("-")

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default Re: Keyword search

    By "how do you do your search" I mean the code.

    Also, by "how is the data stored" I mean, is it the hyphenated version (presumably yes)?
    Please do not ask for code as refusal often offends.

  5. #5
    jasmine2081 is offline Member
    Join Date
    Apr 2012
    Posts
    3
    Rep Power
    0

    Default Re: Keyword search

    For search...i have a .jsp file

    Here is the code.


    String keywords1 = "";
    String category = "-200" ; // default for All Products
    String keywords = Utility.nonNullify(request.getParameter("kw"));
    if (IBE_logEnabled)
    IBEUtil.log("ibeCSrdSrchResults.jsp" , "kw = " + keywords );
    keywords1 = IBEUtil.htmlEncode(keywords);
    if (IBE_logEnabled)
    IBEUtil.log("ibeCSrdSrchResults.jsp" , "keywords = " + keywords1 );
    String operator = Utility.nonNullify(request.getParameter("bo"));
    category = Utility.nonNullify(request.getParameter("cg"));
    String notKeywords = Utility.nonNullify(request.getParameter("nkw"));
    //String dispStart = Utility.nonNullify(request.getParameter("ds"));
    String dispRange = Utility.nonNullify(request.getParameter("dr"));
    String categsPerPage = Utility.nonNullify(request.getParameter("cpg"));
    String itemsPerCateg = Utility.nonNullify(request.getParameter("icpg"));
    String searchType = Utility.nonNullify(request.getParameter("st"));
    String partNum = Utility.nonNullify(request.getParameter("partNum") );




    oraclepreparedstatement = (OraclePreparedStatement)oracleconnection.prepareS tatement("select element_name, element_value "
    + " from mtl_descr_element_values where inventory_item_id = (select inventory_item_id from "
    + "mtl_system_items_b where segment1 = :1 and organization_id = :2) and element_name = 'Item Image File Override'");


    java.math.BigDecimal oi = RequestCtx.getOrganizationId();

    int orgid = oi.intValue();

    String kws1 = request.getParameter("kw");
    String first11 = kws1.substring(0, 4);
    String second11 = kws1.substring(5, 7);
    String third11 = kws1.substring(8, 11);
    String fourth11 = kws1.substring(12, 16);
    String final11 = first11;


    // oraclepreparedstatement.setString(1, ioin);
    oraclepreparedstatement.setString(1, final11);
    oraclepreparedstatement.setInt(2, orgid);

    oracleresultset = (OracleResultSet)oraclepreparedstatement.executeQu ery();


    ------------------------------------------------------------------------------------------------

    kw is the keyword field which we give in the search bar.

    I have taken this keyword and took the partno without hypens using substring method and stored in a variable.
    Can you guide me later how i need to proceed

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: Keyword search

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default Re: Keyword search

    And reading that crosspost highlights why notifying us of it is important...as we have two threads aessentially saying the same thing!
    Please do not ask for code as refusal often offends.

Similar Threads

  1. Search for object by keyword
    By zorrinna in forum New To Java
    Replies: 1
    Last Post: 03-23-2012, 09:08 PM
  2. Replies: 0
    Last Post: 02-24-2012, 08:39 AM
  3. Replies: 4
    Last Post: 03-24-2011, 11:50 PM
  4. Replies: 5
    Last Post: 08-26-2008, 03:43 PM
  5. Replies: 0
    Last Post: 04-04-2008, 09:36 AM

Posting Permissions

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