Indexed search displaying results in another page - search

I want to have a search box on top of the header, but when I submit keywords, I dont want the results to appear on the header, but on the body.
To do this, I thought id have the plugin once in the header and another in the body in a special "Search" page, where I could hide the from in the header when the user was using this page. But I dont know how to do, so that when a search is done, to jump to this other page. (Its sort of like when tt_news has a single pid to go from LIST to SINGLE)
How can I do it to do this jump? Or maybe is there an easier way to achieve what I want?

On common pages you need to construct "pure html" in the header part with the search form where its action is link to the another page - displaying search results. It uses typolink for generating proper form's action.
On the page with search results you don't need to hide the search form, instead you can use TypoScript to fill the search field with value entered on the common page.
There is ready-to-use sample of TypoScript for such scenario placed in Introduction Package, I don't use it so sorry, but I won't paste it here. Anyway you can install it locally and dig for nice snippets and techniques.

Related

Kentico - Content Only page & smart search result

I have a custom page types (Content Only) for Locations. Then I have a landing page (/company/locations/) with repeater to list all locations and their details. Things work well so far. Now, after adding the smart search, I notice that if I search a location name like "san francisco", the landing page didn't show up in search result, but the content-only page showed with a URL like this /company/locations/san-francisco. The thing is, this URL results in 404 since that page doesn't really exist. What should I do? Should I re-create the page type and change it to a regular page instead of content only before it's too late? Or is there a way to make individual location url (/company/locations/san-francisco) work - considering we can't specify a page template to go with content only page type? Thanks!
There are multiple types of Search indexes in Kentico.
"Pages" scans the data of a document, such as any webparts+properties, editable text, form data, etc. They do NOT scan the rendering on the page though, it doesn't catch any Repeaters (what you're using).
"Page Crawler" will literally load the page, and scan all the content in the page. This will catch Repeaters and dynamic content like that.
Knowing this, you have a couple options.
Use Pages, then Modify the Smart Search Result and add some transformation logic to say something like the below
The Link
Use Page Crawler, tell it specifically to only index the /company/locations.
Use Page Crawler, and also a custom smart search indexer so you can exclude the header/footer or other areas out of the content (it's a bit more advanced)
If you don't want that URL to show then simply exclude those page types from that search index. But if you want them to specifically show, then create a detail or selected transformation for that /company/locations repeater to display when someone navigates to it from the search. This will also be good for google and other search indexes if you plan to have specifics for each location.

SharePoint 2010 - Search Box Web Part and Search Results Page Customization

Would someone be willing to offer me some assistance with customizing the search results page and the search box web part properties.
First problem: Search Box Properties
When I add an additional query term (eg. fileextension="xml") the search runs as expected but the refinement panel dissapears on the search results page. I don't want it to dissapear! I just want certain filters to be pre-applied.
Second Problem: Search Results Page
How do I customize the way results are displayed. For instance, I would like to add different refinement options to the refinement panel. I would also like to change what information is displayed under each individual result. Currently it seems to show a summary of the content, followed by the author and sometimes the date. I'd like to change this. How???
Any help greatly appreciated.
The results part you need to update the XSLT, You can do this via one of the web part properties. You will also need to make sure that the fields you want to put in to the results are included in your columns(Also a web part property)
Check this out
https://littletalk.wordpress.com/2011/08/26/customizing-search-core-result-xslt-in-sharepoint-2010/
Refinement options are based on Your crawled properties. Check this out
http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/03/15/get-to-know-the-refinement-web-part-in-sharepoint-2010-enterprise-search.aspx
Not sure as to why your refinement panel is disappearing, Check to see if the URL changes dramatically when you add your fileextension="xml" to the web part property, it may be that this addition is changing the URL so much the refinement panel is loaded or can't load but don't hold me to this
cheers to the
Truez

How can I prevent certain element to get displayed in Google search excerpt?

Currently Google displays elements in the result excerpts that belongs to the functional part of the site. Is there a way to exclude these elements to get crawled/displayed in google?
Like eEdit, eDelete, etc in the example above.
To exclude the pages from Google's index, block them using the Robots.txt file or if it is just the content then use the "rel="nofollow" tag.
Hope this helps.
Update on my particular situation here: I just found out that the frontend code has been generated in a way where the title and the description meta was identical.
Google is smart enough to expect that if a copy is already displayed in the title of the search result there's no reason to add in to the excerpt as well, instead looks for content - believed to be valuable - from the actual page.
Lessons learned:
there's no way to hide elements from google but keep it visible for your users
if you'd like to have control over the content displayed in google searches, avoid using the same copy in your title and description

Drupal 7 -- Publishing and Printing Content Based on Search Results

I am currently working on a project which requires content to be published onto a view or page depending on a search result criteria. For example: I search through my content for the word dog and this word appears on 4 of 20 pieces of content. I wish to view all of those items on a page that is not the Search Results page, but rather one that displays all the content found, so I can print each piece of content.
I apologize if this post is awkwardly worded. At this moment it is just an idea and I am trying to get a better picture of how to change publishing based on search results to a certain area.
Thank you for your time -- and if anyone wishes to ask follow up questions, I'd be more than willing to help clarify.
You can use a view with exposed filter. Create a view, create a filter criteria there, then in settings - check "Expose this filter to visitors, to allow them to change it". A user will see a form in a view, wich you can also make separate from a view, by setting "exposed form" to "yes" and putting it in a sepparate block.

Sharepoint 2010 search: How to modify search query before submit (programmatically?)

I'm making a custom search box Web Part, similar to the OOTB Web Part from SharePoint
(SearchBoxEx class).
I'm interested in modifying the search query with additional text before it is submitted, based on a custom checkbox added on the Web Part.
Any help on how I can achieve this?
UPDATE:
I've used the AppendToQuery and AppQueryTerms properties, but this will rewrite the text in the search box as well. I'm interested in passing the values "in the background", maybe as an extra parameter. Point is that the query modification should happen without the user seeing it explicitly.
In the core result webpart there is a property where you can append text to the query and you will not see that in the textbox.
Best,
Bibhu
I when I had to customize People Search, I opted to roll my own web part and just called Response.Transfer to the Results.aspx and appended query string parameters to the URL. This wasn't the most elegant solution, but it was a quick way to modify the query "behind the scenes."
I'm sure you could develop an application page and set it as the Search Box web part's Results page. Put your custom logic in the page_load and then transfer (or do a form POST) to the actual results.aspx page.
I'm now developing an Extension of SearchBoxEx myself, and I'm currently trying to figure out how to call the base method that submits the query too. This blog shows how to call the internal CreateAdvanceSearchLink method of the SearchBoxEx class: http://pholpar.wordpress.com/category/search/

Resources