Sharepoint 2010 - Pass "u" parameter to advanced search - sharepoint

The scenario - I am building a site to house a number of reports - thirty or so subsites under a main web for different report categories, and several libraries in each site, one for each separate report. In total, about 600 reports (libraries) across the thirty report categories (sites). This design has been decided on, and cannot change.
I plan/want to have a single advanced search page to search all the reports, using various custom metadata columns. That bit's easy, I can do that out of the box.
One of the most important search criteria is which report on which to search, of which, as I mentioned, there are many. The dictate is to make the report type added "invisibly" - they will select the report category, then the report type, and THEN get presented with the search page. The search should "know" which report is being searched on.
Scope selection is not a viable option, as there's too many libraries, and more will be added as new reports are created.
Now, I can get the results I want in the results if I add the "u" parameter to the URL as in;
results.aspx?k="RunDate=1/23/13"&U=http://site/report_type/library"
(address left unescaped for clarity)
My challenge is finding a way to feed that parameter TO the advanced search, and get it to tack it on to the end of its generated query.
I'm confident it can be done with only a little fidgeting to the webpart, but I need a bit of a shove in the right direction.
Or, as always, if y'all have a more brillianter idea, I could do that.
Now, I have a second issue where the different reports have their own varying set of metadata columns, and they only want the RIGHT ones to show up for each report, but one crisis at a time.
EDIT - upon further research, it seems I can't extend the advanced search webpart, as it's a sealed type. Has anyone either a way around that, or have a third-party advanced search page that I CAN crack into?

I was able to find a solution to this issue by overriding the JavaScript function NavigateTo(url) which is responsible for the redirect. My solution can be found here

What you are actually asking about is a contextual search box, as the u parameter resembles the contextual search scope.
I'm not sure that the standard search box can be configured the way you want it to, so it always adds the query string u=<current url>. I think you will have to resort to some (even if simple) code.
An example you can find here: Create a SharePoint Contextual Search Box in a Content Editor Web Part.
Of course you could do the same thing with server side code, but as you only want to add a querytring parameter, JavaScript should be enough.

Related

Search a specific search of a journal article based on the user type

I have this requirement:
We have a journalarticle and we wish to have sections which have content for internal and external users for the application.
We are able to hide the content from rendering by implementing custom template on web content display and using a simple custom-field for a user which helps us to classify it.
Having said that when we search something as an external user, the search portlet is able to fetch an article where the search text is a part of internal user content, and due to the above mentioned template the content is not visible.
In short, from the user's perspective the resultant article does not match the searched term.
I wish to seek some pointer to check whether there is a mechanism to ensure that when an external user searches something then we only search the dynamic-element of the doc which matches the user type?
We have thousands of such articles and create multiple copy of the same article does not seems viable solution.. so any pointers would be a great help.
Liferay version : 6.2 GA4 CE
Thanks!
AJ
First of all: Not finding a search term in a document can be a sign of good working synonym resolution in the search engine. It's questionable if this behaviour is always wrong or only in this particular case. Remember google bombs?
That being said, I believe that this architecture of half-visible documents is flawed from the beginning. Ideally I'd suggest to change it, for example by splitting the information to two articles, so that you can use the standard permissions to resolve. If you link both, you can determine how/which article or template to use. It's not an ideal solution, but might be a workaround.
Another workaround might be to change Liferay's indexer component and index two different versions of the article, with two different permissions. Of course, you'll have to change the search side as well, so that you'll find each article at most once, even if it's now twice in the search engine.
Again - not ideal, but might be the quickest fix that you can get right now without changing the underlying architecture. However, to change the underlying architecture is my actual recommendation.

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

Drupal, Solr & Facet Api - Persistent facet links in blocks

I need to produce facet block from two vocabularies in my site. I am using Views and a patched version of Views infinite Scroll to generate the search page, using my search index, and I have tweaked everything I could in the facet display settings to see if I could produce the requested results, to no avail.
I do not need keyword searches. I need to show all taxonomy terms in each facets at all times and to be able to select a single criteria at a time from each vocabulary. So, never more thane one selection at a time from each facet block.
Why are you using Solr to store data and generate your search page, if you do not need keyword search and are trying to go against the native working of solr Facets, I hear you say? For performance reasons, it is the reason why I am using Solr to store & serve the results, I have even gone as far as pushing renedered node to the index with the help of the somwhat obscure search_api_solr_view_modes module.
I could take two separate routes
Create a custom block, load all the taxonomy terms, alter the output of the term link to point to the view and provide the TID for the View. The active filter data could be obtained from the view arguments. I know how to do that but feel it is the wrong way to go about it, if I am working with Solr, I should be using a facet, not a custom block.
Build a custom Facet block that has this exact behaviour. After reading a lot of documentation, I git kind of dicouraged with the possibility of doing this simply without having to develop a Facet plugin, which is kind of out of my league.
Any advice is appreciated.
Here is a screenshot of the interface I have to produce.
http://imageshack.com/a/img834/9836/kr0i.png
Each taxonomy term has to be persistent, i.e., produce a link event if there are no nodes indexed under this term.
Selecting a term in one of the vocabularies will deselect previously selected terms
Clicking on the x next to a term will remove it form the active search criterias.
Have a look at this. https://drupal.org/project/ajax_facets This might get you to where you need to be. Sans you infinite scroll. There is a youtube video that goes with it. http://www.youtube.com/watch?v=pBj3OkXLyWs
I'd appreciate it if it works as I haven't tried it my self.

Pulling two different sets of data from the same document library in a single page SharePoint 2013

I have a document library set up with multiple different categories of document, and I'm using a metadata column to differentiate between them.
I want to be able to display two different document library web part on a page for different categories of file side by side. This is simple for one category, I just set up a list view filtered by the metadata column, but when I add a second web part alongside the first, it breaks the first one.
I have no idea why this is happening, but it seems like SharePoint isn't happy with pulling two sets of data from the same document library.
When I am editing the web parts, I can get them to both display the documents I want, but then when I click save, the first web part empties.
Not sure what other information would be useful for diagnosing or helping with the problem, so if I haven't given enough detail let me know. I am familiar with SPD as well as developing through the web interface, so if this needs a more complex solution that's fine with me!
Having spent some more time playing around with this, it struck me that I could probably achieve what I wanted using something other than a Document web part, and I was right.
Instead of using the somewhat inflexible document web part, I created a content query web part which only searched within the document library from my site, and filtered by the metadata column.
This way I can create as many queries as I like and they don't interact with each other in weird ways. It also has the advantage of being significantly easier to customise the output without needing to resort to SharePoint Designer.
Content Queries are the answer!

Sharepoint 2010 - Datasheet view and 3 linked lists

I've got a tricky situation I'm trying to determine the best way to solve. I'm a VS developer who is learning SharePoint so it's a little frustrating to me when what I am trying to accomplish could easily be done with code and a db.
I have three lists, a parent and two children list that are linked through lookup columns. The client actually wanted everything in one list but due to SharePoint column type limitations I had to split the data into the three lists, there are over 300 fields. The client wants to see all the lists together in one view and be able to filter and edit groups of items.
I have successfully created a new data source linking the lists and can display that on one of my pages to view. After some research however I have learned that I can't create a datasheet view from this linked view due to limitations in the Office componets that SP uses. Which makes sense.
The business need is for the client to filter the three lists based on criteria they select from either list A AND list B and list C to get a group of items, they make the updates and save the changes back to the 3 lists. They prefer to do this in datasheet view because this mimics the excel spreadsheet that they are currently using that this website will replace. They will potentially be updating between 1-30 items at a time using this, which is why they prefer the drag and copy functionality.
I was thinking of two options: trying to create some kind of custom web part that has a gridview of all the columns in edit mode that they can filter down to their items and make their changes. Then I would have to loop through the fields and make updates programmatically. I also saw on this site jQuery.sheet, that looks like it may be a good solution if I go this route instead of gridview.
Or have a modal window with the columns listed, have the user select what they want to filter to, then redirect to a page that shows the three lists in their own DSVs. The user would have to make updates in the three separate views. Then I would use workflows to synchronize the lists after they had made their changes.
I always end up trying to do things programmatically since I am still largely unfamiliar with SP and only seem to hit its limitations instead of its strengths. Has anyone tried to do something similar to this? Or do you have any suggestions as to the best way to accomplish this? Best practices? I appreciate all thoughts and comments! FYI I've also posted this on the MS SP forums as well to cast a wider net...
Thanks,
Sabrina
In this case, you are better off going with a custom solution. A webpart would be an excellent choice for delivering your custom interface.
A dataview webpart will do the job, but if you feel comfortable with the jQuery solution it would make for a nicer interface.
In your code, treat the lists as you would a database and isolate it from the logic and interface code within the webpart.

Resources