Search result query

Say I have a load of entries in my database, and some have
the phrase 'chicken noodles', some have only the word 'chicken and
others have only the word 'noodles'. When I do a search on the
words 'chicken noodles', I only get the results with the words
'chicken noodles' in.
What I would like to know is how do I also list those records
that have only the words 'chicken' or 'noodles' rather than the
exact phrase; I have no idea how to go about this. Exact phrases I
can get to work fine but if I typed noodles with chicken it
wouldn't show as a result!
What do I have to do for it show similar rather than exact
results?
Any tutorials or advice would be greatly appreciated.
Thanks
Mat

Ok either you can buy Tom's extension, which i 100%
recommend, absolutely
worth it Or go for the tutorial here:
http://www.dmxzone.com/search.asp?SearchString=advanced+search&Action=Search
One of the tutorials will definitely help you. I have used it
before i got
Tom's extension.
LONG LIVE THE TOM MUCK
"matthew stuart" <[email protected]> schrieb
im Newsbeitrag
news:ed5am3$7a7$[email protected]..
> Say I have a load of entries in my database, and some
have the phrase
> 'chicken
> noodles', some have only the word 'chicken and others
have only the word
> 'noodles'. When I do a search on the words 'chicken
noodles', I only get
> the
> results with the words 'chicken noodles' in.
>
> What I would like to know is how do I also list those
records that have
> only
> the words 'chicken' or 'noodles' rather than the exact
phrase; I have no
> idea
> how to go about this. Exact phrases I can get to work
fine but if I typed
> noodles with chicken it wouldn't show as a result!
>
> What do I have to do for it show similar rather than
exact results?
>
> Any tutorials or advice would be greatly appreciated.
>
> Thanks
>
> Mat
>

Similar Messages

  • Search Results Query Text - Get all data, Exclude all list data except one

    Hi Experts,
    I have a situation wherein in the global search of our internal site, we have to display all results & restrict any list item except one list. Earlier we had restricted /Lists/ & People to be displayed in the results.
    But in the new search results I have to display results from only one list along with other results (documents, sites, pages etc).
    Below is the original query text entered in the Search Results Query Text editor
    {searchboxquery} -contentclass:STS_List_Links  
    -filename:allitems.aspx  -Path:/articles/Pages/default.aspx
    -filename:DispForm.aspx  -Path:/Lists/ -Path:person.aspx
    I have tried various different queries with AND, OR operator. I have researched other blogs, sites over google. But unsuccessful. I am sure this is not a rare requirement. Need your expert help.
    I have tried this query also...
    {searchboxquery} (-filename:allitems.aspx -Path:/articles/Pages/ -Path:/Lists/ -Path:/PublishingImages/) OR
    (+(+Path: /Lists/ArticleContent/ AND +filename:*.aspx) AND
    -(-Path: */Lists/* OR -filename:*.aspx))
    Vighnesh Bendre
    MCTS
    http://markviky.blogspot.com

    Vighnesh,
    You should have success using the following:
    {searchboxquery} -contentclass:STS_List_Links -filename:allitems.aspx  -Path:/articles/Pages/default.aspx -Path:person.aspx ((-filename:DispForm.aspx  -Path:/Lists/) OR Path:/Lists/ArticleContent/)
    Two things from your original query were excluding list items from your results, your exclusion of file
    DispForm.aspx and path Lists.  By using "OR" in the above query, we're creating an exception to also allow items under
    Lists/ArticleContent to be included in the results.

  • Help with Search Result Query Builder (CSWP)

    Greetings,
    Is there a way to limit the number of search results returned based on each property value?  Hard to phrase my question, so I'll give my example.
    I have a Content Search Web Part that is returning results from a specific list that has a column called Category with 6 options (ex, A, B, C, D, E, F).  I want my query to return the newest 4 items by date that are tagged from each category value.
     So, latest 4 items tagged with A, latest 4 tagged with B, etc.  My CSWP would return 24 items from the query.
    Hope that makes sense.  So, is this possible through the Search query?
    Thanks!
    -B

    Hi Brian,
    Per my knowledge, it is impossible to do via Search Query in Content Search web part.
    As a workaround, you can add a Refinement Web part into the page, then click the refiner to filter each options to display the latest associated four items.
    You can do as the steps(assuming I create a list with a column called “testCategory”, like your Category column ):
    Do a full crawl for the content source.
    Create a managed property called “testCategory” to map it to the crawled property
    ows_ testCategory.
    Then do a crawl again for the content source.
    Go to a page, add a Refinement web part and a Content Search web part into the page.
    Edit the Refinement web part->Choose Refiners, add testCategory under
    Available refiners into Selected refiners.
    Remove other refiners except testCategory, click OK and OK.
    Edit the Content Search web part->Change query.
    Select a query: Local SharePoint Results, and the Query text is : Path:<the URL of the list>
    Click SORTING tab, and Sort by: LastModifiedTime(Descending), click OK.
    Under Change query, Number of items to show: 4.
    Click OK, and save the page.
    The result is like:
    After Clicking A, we can see the latest 4 items related to A:
    Best Regards,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • Sending search box query text as is to opensearch result source.

    I have a Sharepoint online 2013 subscription. I created a Sharepoint site and configured a search result source, search result query for a custom opensearch backend. I want to pass the search query entered by user as is without any transformations to opensearch
    backend,but everytime user enters search criteria SharePoint is transforming it to KQL before sending it to opensearch backend. Is their a way to bypass all these transformations and send search query as it is ?

    Hi Ram,
    Here is an article which describes how to integrate Bing to SharePoint (online) 2013 search:
    http://www.jasperoosterveld.com/2013/05/integrate-bing-with-sharepoint-online-2013-search/
    If you refer to the How the search system processes a query part in the article below:
    https://technet.microsoft.com/library/jj219620(v=office.15)#HowQueryProc
    You will find out that before "Sending the query to the search index or another search provider", search system will be "Parsing the query and creating a query syntax tree for internal use" and "Processing the query linguistically
    by performing word breaking, stemming, spelling correction, and synonym expansion".
    Sometimes we could put query words in Double Quotes, so that search system will treat them as an entity. If this still doesn't solve your issue, please explain more about your issue or make an example.
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Search Results Are Highlighted Within The Text Box? How ? Access 2013

    Hi Every one ,
    Below I am describing some coding issue in VBA-MS Access I am facing right now , and I hope u guys could help me resolve the issues :
    DB : MS access 2013 - RichTextBox In A Form -
    Language : VBA
    Problem In short : struggling to highlighting user search word within the search result query ..
    What I want :
    Helping to fix the second code shown below , the one I used to highlight ( reformat ) the text who's bound to a a field that store memo data type . code
    My Result Search Query VBA COde ( Work perfectly )
    strWhereToSearch = IIf(.framSearchIn.Value = 1, "[quknotSubject]", "[quknotBody] ")
    strCondition = strWhereToSearch & " Like '* " & strTextSearch & " *' OR " & _
    strWhereToSearch & " Like '" & strTextSearch & " *' OR " & _
    strWhereToSearch & "Like '* " & strTextSearch & "'"
    strSql = " Select * from qryExtraTool_QuickNoteSubCatMainCat "
    strSql = strSql & " WHERE " & strCondition & " ORDER BY quknotDate"
    The code that i am struggling to make it work for me to highlight the search word inside the textbox called .txtQuickNoteBody :
    'Control Source for the text box to display matches.
    Const strcTagStart = "<font color=""""red"""">"
    Const strcTagEnd = "</font>"
    strControlSource = "=IIf(" & strField & " Is Null, Null, " & _
    "Replace(" & strField & ", """ & strSearchValue & """, """ & _
    strcTagStart & strSearchValue & strcTagEnd & """))
    .txtQuickNoteBody.ControlSource = strControlSource
    Thank u all in advance .

    Thank u so Bruce , I finally found an answer to my question.
    The solution u provided looks complete except that i am confused by the meaning of strField , may i didnt provide more details in my  post .
    The strField var i provided earlier was not meant to be placed in my code  , the correct one is shown below .However , the strField means according to me is the field against which the search operation should take place based on the ( search Term )
    the user provided . 
    Here is the code after applying the solution u suggested :
    'Information collected from the user      
     strWhereToSearch = IIf(.framSearchIn.Value = 1, "[quknotSubject]", "[quknotBody] ")       
    strCondition = strWhereToSearch & "  Like '* " & strTextSearch & " *' OR " & _
    strWhereToSearch & " Like '" & strTextSearch & " *' OR " & _ 
    strWhereToSearch & "Like '* " & strTextSearch & "'" 
    'Fill result search  Recordset      
    strSql = " Select  * from qryExtraTool_QuickNoteSubCatMainCat   "         
    strSql = strSql & " WHERE   " & strCondition & "  ORDER BY quknotDate"  
    'Control Source for the text box to display matches. ( Highlight the search word )     
    txtQuickNoteBody = SearchHilight(strWhereToSearch, strTextSearch)
    Tell me if my implementation to your code is right ?
    Thank u again Bruce ...

  • If Condition in Keyword Query Language (SharePoint 2013 Search Results)

    Hi All,
    Can we have an "If" condition in Query text box in SharePoint 2013 Search results page. For example, i want to hide all list items whose
    status is "HideItem" from appearing in search results?
    I am trying this: {?{searchTerms} (contentclass:STS_ListItem -ListItemStatus:"HideItem")}
    But, this hides all items like aspx pages, pdf's, docs and displays only list items. 
    Similarly, hide pages of some name like: AllItems.aspx, ViewDetails.aspx, AllAssets.aspx 
    {?{searchTerms} (contentclass:STS_ListItem_850 -filename:"AllItems.aspx")} 
    Any help would be great. Thanks in advance.

    Thanks Steve. I found this solution after a bit of struggle :).
    Also, date comparision is not working as expected. 
    {?{searchTerms} NOT(contentclass:STS_ListItem AND ListItemStatus:"HideItem" AND
    PublishDate<{Today})} is not working and throwing syntax error.
    I don't see any solid reference to KQL syntax except this msdn link.
    Can you please suggest any good material on KQL syntax ?
    Thank you once again.

  • How to configure search results web part to display results only after a query is generated from user?

    Hi All,
    I am crawling documents from a file server. I created a new content source and crawled the documents. All documents are crawled successfully.
    Then I went to my enterprise search center site collection and created a new result source. I have added the query to use above content source.
    After that, on a page I am trying to configure the search results web part to display documents using this result source. Now the problem is:
    It displays all the documents that are crawled without searching for anything. I mean first it should not display any results. If a user searches for something , then according to that search it should display results.
    Any idea how to do this in the web part? I am using SharePoint 2013 on premise enterprise edition. No code. Totally OOTB.

    Hi Mohan,
    What did you use for the Query text in the result source?
    I could reproduce this issue when I used Query text like: {searchTerms} Path:”http://sps2k13sp/sites/First/Shared%20Documents”
    Then I changed the Query to
    {?{searchTerms}
    Path:"http://sps2k13sp/sites/First/Shared%20Documents"}
    , then Search result web part didn’t return results without searching.
    So , check your result source, and use the Query like the above(adding "{?...}").
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Access query strings in a search results page with custom display template

    am trying to create a  custom display template in my search results page , so i went to download the itemdefault html file and renamed it and  saved as  different file.and  am started to updating.
    the issue i am facing here is : in my  search results page there are 2 query strings, which are passed by anotehr .net appln[ another asp.net appln will be sending the query string to my sp 2013 search results page]
    but, how can i  read these 2  query strings using jslink and  new token _#- ? 
             <!--#_
               var QStringResults= null;
    ctx.OnPostRender = [];
    ctx.OnPostRender.push(function(){ 
    QStringResults= getQuString(); //here am unable to read the QStringResults value 
     _#-->  
    the below is my cstomhtml file
    am unable to  get the values :
                   <a href="http://srvrname:2013/sites/CMP/_layouts/15/BIFAddInputRef/bifpage1.aspx?bif1=_#= $htmlEncode(QStringResults) =#_"> Add Input Reference </a>
    <html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"> 
    <head>
    <title>Item BIF</title>
    <!--[if gte mso 9]><xml>
    <mso:CustomDocumentProperties>
    <mso:TemplateHidden msdt:dt="string">0</mso:TemplateHidden>
    <mso:MasterPageDescription msdt:dt="string">Displays the default result item template.</mso:MasterPageDescription>
    <mso:ContentTypeId msdt:dt="string">0x0101002039C03B61C64EC4A04F5361F385106603</mso:ContentTypeId>
    <mso:TargetControlType msdt:dt="string">;#SearchResults;#</mso:TargetControlType>
    <mso:HtmlDesignAssociated msdt:dt="string">1</mso:HtmlDesignAssociated>
    <mso:ManagedPropertyMapping msdt:dt="string">'Title':'Title','Path':'Path','Description':'Description','EditorOWSUSER':'EditorOWSUSER','LastModifiedTime':'LastModifiedTime','CollapsingStatus':'CollapsingStatus','DocId':'DocId','HitHighlightedSummary':'HitHighlightedSummary','HitHighlightedProperties':'HitHighlightedProperties','FileExtension':'FileExtension','ViewsLifeTime':'ViewsLifeTime','ParentLink':'ParentLink','FileType':'FileType','IsContainer':'IsContainer','SecondaryFileExtension':'SecondaryFileExtension','DisplayAuthor':'DisplayAuthor','CMPBIFURL2':'CMPBIFURL2'</mso:ManagedPropertyMapping>
    <mso:_dlc_DocId msdt:dt="string">X3CVW7PXYF6P-3-222</mso:_dlc_DocId>
    <mso:_dlc_DocIdItemGuid msdt:dt="string">3ed12157-ea19-4591-b9cd-7a826aef35dc</mso:_dlc_DocIdItemGuid>
    <mso:_dlc_DocIdUrl msdt:dt="string">http://srvrname:2013/sites/CMP/_layouts/15/DocIdRedir.aspx?ID=X3CVW7PXYF6P-3-222, X3CVW7PXYF6P-3-222</mso:_dlc_DocIdUrl>
    </mso:CustomDocumentProperties>
    </xml><![endif]-->
    </head>
    <body>
        <script>
            $includeLanguageScript(this.url,"~sitecollection/_catalogs/masterpage/Display Templates/Search/BIFJScript.js");
        </script>
        <div id="Item_BIF2">
    <!--#_ 
            if(!$isNull(ctx.CurrentItem) && !$isNull(ctx.ClientControl)){
                var id = ctx.ClientControl.get_nextUniqueId();
                var itemId = id + Srch.U.Ids.item;
    var hoverId = id + Srch.U.Ids.hover;
    var hoverUrl = "~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Default_HoverPanel.js";
                $setResultItem(itemId, ctx.CurrentItem);
    if(ctx.CurrentItem.IsContainer){
    ctx.CurrentItem.csr_Icon = Srch.U.getFolderIconUrl();
    ctx.currentItem_ShowHoverPanelCallback = Srch.U.getShowHoverPanelCallback(itemId, hoverId, hoverUrl);
                ctx.currentItem_HideHoverPanelCallback = Srch.U.getHideHoverPanelCallback();
    _#-->
             <!--#_
               var QStringResults= null;
    ctx.OnPostRender = [];
    ctx.OnPostRender.push(function(){ 
    QStringResults= getQuString();
     _#-->  
            <div id="_#= $htmlEncode(QStringResults) =#_" name="bifItemqstring" 
                    data-displaytemplate="DefaultItem" class="ms-srch-item" 
                    >
                    <h5 style="color:ghostwhite;background-color:black">
                        <a href="_#= ctx.CurrentItem.Path =#_"> _#= ctx.CurrentItem.Path =#_</a>
                    </h5>
                </div>
                <div id="_#= $htmlEncode(itemId) =#_" name="bifItem" 
                    data-displaytemplate="DefaultItem" class="ms-srch-item" 
                    onmouseover="_#= ctx.currentItem_ShowHoverPanelCallback =#_" 
                    onmouseout="_#= ctx.currentItem_HideHoverPanelCallback =#_">
                    <h1 style="color:ghostwhite;background-color:black">
                        <a href="_#= ctx.CurrentItem.Path =#_"> _#= ctx.CurrentItem.Path =#_</a>
                    </h1>
                    <h4 style="color:ghostwhite;background-color:black">
                        <a href="_#= ctx.CurrentItem.Description =#_"> _#= ctx.CurrentItem.Description =#_</a>
                    </h4>
                    <h4 style="color:ghostwhite;background-color:black">
                        <a href="_#= ctx.CurrentItem.LastModifiedTime =#_"> _#= ctx.CurrentItem.LastModifiedTime =#_</a>
                    </h4>
                    <h3 style="color:floralwhite;background-color:green">
                        var mybifurl1= document.getElementById($htmlEncode(QStringResults));
                    <a href="http://srvrname:2013/sites/CMP/_layouts/15/BIFAddInputRef/bifpage1.aspx?bif1=_#= $htmlEncode(QStringResults) =#_"> Add Input Reference </a>
                    </h3>
                  </div>
            <div>
            </div>
                    <div id="_#= $htmlEncode(hoverId) =#_" class="ms-srch-hover-outerContainer"></div>
    <!--#_ 
    _#-->
        </div>
    </body>
    </html>
    when i run the page , i a getting the query string value as   undefined! though the custom javascript is getting called.

    i am able to get the  results  by implementing the below:
    <h4 style="background-color:black">
                        <a onclick="javascript:mycalltojs(_#=
    ctx.CurrentItem.Path=#_) > click here </a>
                    </h4>
    hope this helps  anyone

  • Using "Restrict by app" in change query causes issues with Search Results

    Hello!
    I am hoping some experienced SP admin can help me out. I am having issues with the relevance ranking for my search results web part.
    I created a Wiki (OOTB) within a site collection and on the home page of the Wiki I was looking to apply a Search Box and Search Results web part for easy searching. I wanted to ensure the search results were restricted to the scope of the pages within the
    wiki. I did the following after adding the 2 web parts:
    Entered edit mode for the page
    Started to edit the Search Results web part
    Under Properties for Search Results clicked on "Change Query"
    Navigated to BASICS and clicked "Switch to Quick Mode"
    For Select Query, picked "Wiki (System)" option
    For Restrict by app, picked "Specify a URL" and input the wiki URL "http://webapp.com/sites/sitecollection/wiki"
    Click OK
    The web part has 6 automatic results when I hit the page. These are the only 6 pages in my wiki. When I search a word or title of a page, they are not ranked in order or relevance. The ordering is static to what was being shown before the search, but the
    keywords I'm searching are bold. With out the taking the steps above, I can easily search these pages and have them ranked appropriately so I'm not too sure what I'm doing wrong. 
    Other Details
    The pages have been crawled and can be searched from anywhere else in SP.
    I am only a site collection admin for this specific site collection.
    I other than the steps above, I have not made any changes or customization to the search web parts; they are both out of the box SP.
    The SP Farm admin we unable to pin point what the root cause is either.

    Hi Mikael,
    Sorry for the wait, I was unable to post pictures, which i felt would better describe my issue.
    Could you output the query template you are ending up with?
    If you can tell me how to accomplish this, then I can provide it. Please keep in mind that I am only a site collection admin.
    Also, is the ranking/sorting for your webpart set to ranking?
    When looking at the web part settings, I didn't see an option to modify the ranking. Unfortunately, some sites in my intranet are down now so I can't even double check. Once it's back up, I will verify this as well.
    And how do you know they are ranked incorrectly?
    I wanted to display an image showing what I meant by this. As the wiki is down, I'll do my best with words. When I visit the wiki home page, I already have the search and search results web parts there. Without searching anything, the search results
    web part displays 6 pages that are available in the wiki. When I search, I expect to see the most relevant result at the top. similar to the following: 
    *Search result from another section of the intranet site.*
    What I receive instead is the same list of wiki pages, in the same order. The most relevant result
    is not moved to the top like in the image above, but I can see that the word "rush" is highlighted in bold. I hope this helps.
    If you need more of a description, please let me know.
    Thank you

  • Search Results web part - Custom Query using "Value with a parameter from URL" inconsistent

    I have encountered what I think may be a bug, but I am hoping that there is something that I am missing.
    Within my search site, I have created a new search results page where I want to customize the "Search Results" web part query.  I can add in any number of property and keyword filters (using the "Build Your Query" dialog) without
    issue... until I add a filter that uses the QueryString property (the builder dialog calls this "Value with a parameter from URL").
    If I use {QueryString.MyParameterX} for filtering, it works beautifully in the query builder dialog.  I see the expected results in the search results preview pane, but as soon as I apply the changes things become inconsistent. 
    If I close/reopen my browser and navigate to my page at http://myaddress/search/Pages/testresults.aspx?MyParameterX=test I see results.  If I then refresh the page, I get a "Nothing here matches your search" message.  I can then go to
    the same address but change one character to an uppercase character and get results.  Refreshing that same page again returns "Nothing here matches your search".  I can only get search results one time per uniquely cased URL without having
    to close/reopen my browser.  This behavior was seen on both Firefox and IE.
    Finally, I found that if I instead navigate to http://myaddress/search/testresults?MyParameterX=test, it always returns results.  This, unfortunately isn't the best solution for me... but it is a solution.
    Any insight that anyone can provide is greatly appreciated!  I would really like to be able to depend on this working in all logical cases (especially since the search center of other sites is set using the path all the way down to /Pages).
    Thanks!

    Hi, have you been able to solve this issue? I'm getting the same issue and I cant solve it (required CU is installed).
    Fabio

  • Query of Search Results

    I need some best practices advice.  I'm not sure if there is a better way to do what I'm trying to accomplish.  The execution time is very high which is why I'm looking for alternatives.  I welcome any tips to help reduce this execution time.  Hopefully, I can explain this clearly because I'm not seeing it clearly.  I'm going to just use one form field for this example, however, there are about 10 search field options.
    Multiple items (checkboxes) can be selected for one field.  I am going to use CODES for my example.
    The cfquery on the results page uses a view that has been created in the database.  This view joins a primary table (company) to several other tables (i.e., codes) that possibly have many records for that one company.  Within the cfquery, I use IN for the joined tables just to see if that company has any of those records.  It appears to be working and not taking too long.  In order to output the results, a  distinct company is being used because multiple rows could be returned for one company, and I only want to output each company one time. 
    Then, I want to output the company information.  I also want to output the multiple codes for returned for each company.  So, I have to do a little query within the main query output to get those records.  Because there are so many search field options, this is where I believe the execution time is slowing down because is has to loop very every company returned (800+) and multiple search fields means different queries.  Below is a sample piece of the code.
    I am thankful and open to any ideas.  Sincerely.
    <cfquery datasource="xxx" name="Company">
    Select distinct company
    from vwCompany
    where active='true'
    cfif isdefined("code") and code neq ''> and code IN (<cfqueryparam value="#form.code#" list="yes">)</cfif>
    </cfquery> 
    <cfoutput query="company">
    <CFQUERY DATASOURCE="xxx" NAME="getCodes">
        SELECT     *
        FROM     tblCodes
        WHERE code IN (<cfqueryparam value="#form.code#">)
    </CFQUERY>
    #company#
    codes: #valuelist(getcodes.code)#
    </cfquery>

    Thank you all for your input.  As a follow-up to what seems to have helped and to help others is a description below.
    I was having trouble getting an accurate recordcount of companies using the primary query (search results) because it was creating rows for the joined tables with a one-to-multi relationship.  It was accurately counting all the rows (multiple codes) returned and not just the distinct field (company) that I needed.
    I worked around it by using query of queries to get the accurate recordcount off of that primary query (companies used in previous example which I will rename as getcompanies since it is the same name as a table column).
    <cfquery dbtype="query" name="records">
    Select distinct company
    from getcompanies
    </cfquery>
    I then output each company record and their associated codes by using another QoQ:
    <cfoutput query="getcompanies">
    <cfquery dbtype="query" name="getcodes">
    Select codes
    from getcompanies
    where companyid= <cfqueryparam value="#getcompanies.companyid#" cfsqltype="cf_sql_integer">
    and code is not null
    </cfquery>
    #company# Codes:</strong> #valuelist(getcodes.codes, ", ")#
    </cfoutput>
    If anyone knows of a more efficient way, I always welcome the suggestions.  It seems to have reduced the execution time from 16K ms to 6K ms, but I'm still trying to get the execution time down to under 250 ms.  There are only 800 records.

  • Converting an Ultra Search result to a ColdFusion query

    Hello,
    I'm trying to convert an Ultra Search result into a ColdFusion query.
    There's a java class for CF which turns a java result into a CF query, coldfusion.sql.QueryTable(java.sql.ResultSet), but is there anything which will convert an Ultra Search result to a java result or a CF query?
    Thanks.

    HOMEWORK ALERT HOMEWORK ALERT
    You can't cast from a character to a String. That doesn't work.
    However, in a fit of being helpful.
    Look at the constructors for the String object in the API
    Link ===> http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#String(char[])
    char[] charA = {'H', 'E', 'L', 'L', 'O', ' ', 'W', 'O', 'R', 'L', 'D' } ;
    String a = new String(charA) ;
    System.out.println(a) ;There's a price for my help, and it's this. Now that you understand what you can do, is it a good idea or a bad idea and why ???
    Explain.

  • OA Query Region shows previous search results when moving between pages

    Hello All,
    I have a custom OA Page which has a query region based on a LOV for searching device names. The problem I am facing is once device name is searched and I go to another page through the quick links and come back to same Search Device page, it shows the previous searched results. I am not retaining AM for any page navigation.
    Things I have already tried :
    1 . I have tried refreshing VO by using clearcache and reset methods on VO.
    2. Get the Go button from the query region in ProcessFormRequest and on Go button click I use forwardImmediatelyToCurrentPage. And in Process Request method I am querying the results manually when Go button is clicked. Otherwise I am manually making the where clause condition 1=2 and ensuring that the VO does not return any rows.
    But still I am not able to get rid of the issue.
    The code used is pasted below for your reference. It is urgent. Can you please provide any pointers.
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    try
    VpaAdminAMImpl am = (VpaAdminAMImpl)pageContext.getApplicationModule(webBean);
    TkvpaDeviceSearchVOImpl deviceAll = am.getTkvpaDeviceSearchVO1();
    deviceAll.clearCache();
    deviceAll.reset();
    deviceAll.setWhereClause("1=2");
    deviceAll.setWhereClauseParams(null);
    String query = deviceAll.getQuery();
    System.out.println("getSearchResult query :="+query);
    deviceAll.executeQuery();
    OAQueryBean queryBean = (OAQueryBean)webBean.findChildRecursive("region1");
    String goAction = queryBean.getGoButtonName();
    if(pageContext.getParameter(goAction) != null)
    getSearchResult(am, pageContext, webBean);
    catch(Exception ex)
    throwException("SearchDeviceCO.processRequest",ex);
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    String action = pageContext.getParameter(EVENT_PARAM);
    OAQueryBean queryBean = (OAQueryBean)webBean.findChildRecursive("region1");
    String Go = queryBean.getGoButtonName();
    System.out.println(pageContext.getParameter(Go));
    if(pageContext.getParameter(Go) != null)
    pageContext.forwardImmediatelyToCurrentPage(null,false,"N");
    public void getSearchResult(VpaAdminAMImpl am, OAPageContext pageContext, OAWebBean webBean)
    try
    String device = pageContext.getParameter("deviceSearch");
    StringBuffer sb = new StringBuffer();
    if(device != null && device != "")
    sb.append(" DEVICE_NAME = '");
    sb.append(device);
    sb.append("'");
    String sql = sb.toString();
    TkvpaDeviceSearchVOImpl deviceAll = am.getTkvpaDeviceSearchVO1();
    deviceAll.setWhereClause(sql);
    deviceAll.setWhereClauseParams(null);
    String query = deviceAll.getQuery();
    System.out.println("getSearchResult query :="+query);
    deviceAll.executeQuery();
    }catch(Exception e)
    e.printStackTrace();
    Thanks in Advance,
    Abhishek Mishra

    Hi Anand,
    The getSearchResult method also does the same thing. I have also tried to remove the dependency on getSearchResult and wrote the same code in ProcessRequest() but still it does not solve the problem.
    In fact, I have ensured that the VO does not contain any records and have checked these by using SOPs and debug in JDEV. The interesting point is the VO does not have any records but still the previous search data and search criteria is shown when we navigate to the page. Printed the query just before performing execute query and that query does not return any records. Also tried printing something if there are any records in the VO by using vo.hasNext().
    Data gets stored somewhere and it is shown when the page is navigated from other page. FYI, this page is accessed from quick links and there are other pages also in the quick links and when we navigate between these pages we get to see the previous search results. Tried methods clearCache(), reset() on VOs but still unsuccessful.
    Not even that I thought that the VO may be corrupted in some sense so I created a new VO instance in the AM and then used newly created VO instance in the query region. But still no luck.
    Any pointers will be appreciated.
    Thanks in Advance,
    Abhishek

  • Issue in disabling button and retaining search results of query bean

    Hi,
    I need help in 2 issues
    1) I have a query bean and an advanced table attached to it. I have enabled table actions and put a button inside that. The requirement is the button should be enabled only if a record is present in the advanced table. If for a search parameter, no results are displayed in the advanced table, the button should remain disabled. The moment the results are populated in advanced table the button should be enabled. Please let me know how this can be achieved.
    2) In the advanced table there is a column of type Link. On clicking this link i am forwarding the control to some other OAF page AA. I am retaining AM here. From this new OAF page AA user can move to some other OAF pages B or C. All these pages have different AM. There is a link called return to original page on page AA which takes user back to the search screen. When user goes to page AA and comes back to search screen without going to page B or C the search results are displayed on the page, but when user goes from page AA to page B or C and finally returns to the search screen, the data in search results along with search criteria are lost. The search screen is completely blank.
    I need to display the search results/search criteria no matter what navigation user is doing. Is there a way i can save the search query that got executed on the click of search button. I can re-execute the query when user comes back on search screen.
    Please let me know how to achieve these 2 functionalities.
    Thanks,
    VG
    Edited by: VG on Sep 6, 2011 2:55 PM

    For (1)
    I guess you want to select single/multiple rows after the table is populated in table and perform an action using button.
    If that is the case then do not put button under table actions. Instead put it under multiselection region. Then button only gets displayed when rows are populated.
    If that is not the case then get a handle to button (use findChildRecursive, findIndexedChildRecursive may not work) and disable/enable it.
    For (2).. If you are on r12 below can be useful :- (taken from 12.1 framework guide)
    Using Search Persistence
    In the past, if a user performed a search and then drilled down to a details page, search criteria was lost when
    the user navigated back to the Search page, unless the developer retained the AM or created a custom
    implementation to persist the search criteria. As of Release 12, developers no longer need a custom
    implementation to persist search criteria, as the query region now has an automatic search persistence
    mechanism in place.
    Generally speaking, you should still retain the AM in favor of using the automatic search persistence
    mechanism for performance optimization reasons. However, if retaining the AM presents a scalability issue
    because the underlying view object (VO) had hundreds of attributes, then you should you turn off retainAM and
    allow the query region to automatically handle all the search criteria binding and use the automatic search
    persistence mechanism.
    Note: If you retain the AM state, the automatic search persistence mechanism will not be active. The search
    persistence mechanism is automatic only if the AM state is not retained.
    When a user selects the Go button to initiate a search on the query region, the OAQueryBean automatically
    caches the search criteria on the user session. After the user drills down to the detail page of the Search
    results and then returns to the Search page, the OAQueryBean restores the search criteria from the cache and
    re-executes the query using that saved critieria.
    Note: Since the query is re-executed, any sort, navigation or transient UI state of the results table will not be
    preserved. Saving the entire table state presents high overhead which is what this particular feature is trying to
    avoid.

  • Content search webpart query is not rendering result as per the expectation !!

    Hello,
    I have 5 Content search web part on same page with different display templates.
    1) Search Aggregated Result - This display search results for announcements,discussion and wiki as per the current user.
    2) My websites - Thsi displays site links as per the current user.
    3) My Tasks - This display task items as per the current user
    4) Daily calendar - This display the results as per the date selection in calendar control.
    For Daily calendar - I have specified calendar control in custom display template to filter search results based on date selection which is working as below:
    I have got the reference from following link that changing the query dynamically to filter search result data - 
    http://sharepointificate.blogspot.in/2014/08/content-search-webpart-dynamic-filtering.html
    ctx.OnPostRender = [];
    ctx.OnPostRender.push(ctx,function(){
    $('<div id="trCalendar" class=""></div>').insertBefore('#idCalender')
    $(document).ready(function () {
    $("#trCalendar").datepicker( {
    onSelect: function(date) {
    var groups = Srch.ScriptApplicationManager.get_current().queryGroups;
    $.each(groups, function () {
    // Look for query groups associated with a CSWP
    if (this.displays != null && this.displays.length > 0) {
    if (this.displays[0] instanceof Srch.Result) {
    // Update and execute query
    var newQuery = 'ContentTypeId:0x0102*'+ ' ' +'EndDate'+ '>=' + date;
    this.dataProvider.set_queryTemplate(newQuery);
    this.dataProvider.issueQuery();
    selectWeek: true,
    However, this date query is being applied for every search result web part mentioned in page.
    How can I make it work only for the Daily Calendar web part ?
    Your answer will be much appreciated.
    Thanks and Regards,
    Dipti Chhatrapati

    Dipti,
    How about replacing you line as below (with content class)
    var newQuery = 'ContentTypeId:0x0102*'+ ' ' +'EndDate'+ '>=' + date;
    with
    var newQuery = 'contentclass:STS_ListItem_Events'+ ' ' +'EndDate'+ '>=' + date;
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

Maybe you are looking for