Search internal content fields - orchardcms

How can I set up a search on the Manage Content page so that I can search not only by headings but also by internal fields? for example htmlbody
enter image description here

When the search feature is enabled, each content type has a setting to define exactly what is part of the search index. What you are asking for should be the default.
What might be your issue is that your content type is not selected in the index you created.
If you want to add more fields, then in the "Full-Text" section of the content type definition, check "Use custom full-text".

Related

Does Drupal provides interchanged/partial word search facility?

Does Drupal provides interchanged/partial word search for example: If i'm searching for "search term" should also return search result says that "term search".
Actually there's a quick way to set this up with the Search API and the Search API Database Search modules. No need for Solr.
Enable both the modules and go to the Search API configuration page
(admin/config/search/search_api)
Add a server and give it a recognizable name (such as "MySQL"), make sure it's enabled
Choose the following service class: Database service (normally the only option. If you don't see it, make sure that the "Search API Database Search" module is enabled).
Selecting this service class will provide you the option Search on parts of a word (make sure you enable it). Now hit "Create server". Next, go back to the Search API configuration page, and add an index. Again give it a recognizable name, such as "Contentindex", and make sure it's enabled.
Select the server you recently created (in this example "MySQL"). Datasource options: check the content types you want to index (the description of this field may be a bit confusing, but make no mistake: you should check the content types you want to index, not the ones you want to leave out).
You could check "Index items immediately", but that depends on the size of your content. This option is alright for smaller websites. In the other case: let cron take care of it. Hit "Create index".
Next, you want to enable the fields (in the fields tab) to that very index, e.g.: contant type, title, status and author - and hit "Save changes" (we'll take care of the related fields later).
Then you want to configure the filters (in the filter tab). Here you can enable the bundle filter, if you want to finetune the content types once again (probably won't need to).
Down below you'll find the highlight filter, to highlight the search word in the results.
Now return to the fields tab and unfold the "Add related fields" tab. Add all the fields of which you want to get the content indexed, and hit Save Finally go to the "view" tab of the index, and index now all the items.
The last step is to create search results page and search block in Views, which only takes a few minutes.
Make sure the submodule Search Views is enabled and create a view page which will show "Contentindex" (select the name you gave to your index configuration instead of "content" which is selected by default.
Add all the fields (make sure your format is "fields") that every search result should consist of (title [link to content], body, …).
You'll notice that these fields look like this Indexed Node: Title
Add an exposed filter: Search: Fulltext search; and select the following in its settings: Contains any of these words, and use as: Search keys.
You're done!
There's an excellent video tutorial on this partial search method without Solr, which also incorporates faceted search (which is not necessary for partial search, but in case you're interested…). If you're only looking for a partial search option, you can watch the video until 5:08 and after that skip to 6:45.
Reference:
https://www.drupal.org/node/84631

Enable search for a Projection with custom Content Items

I've created a custom content item. I also have a projection which filters the content items (e.g. on a tag or something else).
I've installed the Modules: Search, Indexing and Lucene but when I search for an article I don't seem to find any of my custom Content Items.
How can this be done?
I'm using Orchard 1.5.1
Nevermind.
After installing search the "Index this content type for search" was not directly visible on my custom Content Item.
The field appeared when I added another Field to my Content Item and saved it.
That is the reason I could not find or select it :-)

Get listitems from Current Site

I am trying to create a Page Layout, that should have a lookup field. Lookup field should always get populated with a list's items.
This list will exist in all subsites, so whereever I create this page, list should get populated with listitems from current site.
I tried using site column lookup field, but it always point to list under top site and not the current site.
Any suggestion on how to make it work or better alternative? Thanks!
Let me know if I can provide more info.
The most straightforward solution I can think of is using a cross site lookup column and creating a seperate fields for each subsite. However, you will need to create and use different Page Layouts for each subsite.
You can use http://sp2010filteredlookup.codeplex.com/ for cross site lookups.
Solution 1 - Use http://sp2010filteredlookup.codeplex.com/
Use filtered lookup solution. So let's say you have your custom Page Layout and custom Page Content Type.
Every time you create new subsite, you should remember go to Pages list settings and edit Page Content Type by adding cross site lookup (with the same field "internal name").
So you still have one Page Layout (and one Content Type). But for each Pages library instance, Content Type contains diff fields (but with the same Internal Name). It will allow you run CAML queries and other things needed without any problems.
Solution 2 - develop custom sharepoint field type.
In edit mode, control will render "dropdown list" and populate data from list instance that is on current subsite. In the field settings you can have relative list url.
Solution 3 - hidden text field / js snippet solution
Page Content Type can contain hidden text field (it can contains selected field value in json format for example). Develop js snippet that will handle all the logic (rendering in edit/view mode, saving etc) and put it on Page Layout (aspx).
I would suggest to use solution #1 or #2.

Document Library Crawl

I set up a new scope and passed in the URL for a specific document libary that I created that hold 2 word documents.
For some reason when I start a full crawl, it does not see the 2 word documents.
The word documents have meta data and I've created Managed Properties that map the crawled properties.
I am trying to utilize the Advanced Search webpart to be able to search from this scope. When I enter a search term such as the filename of the word document, no results are returned.
Any ideas?
You need to enable the document library to be searchable. Enable it through the document libraries properties.
Edit
See Harnessing Properties in SharePoint Search
To get to the Document Library Advanced Settings page, from within a given library, select the Document Library Settings menu item from the Settings dropdown, and then select the Advanced settings hyperlink under the General Settings header. Somewhere in there, you should see something like the following image. Make sure that the radio button is set to Yes. Source
(source: bamboosolutions.com)
What account is the crawler running as? Maybe that account doesn't have read permission on the list, so it can't index it.
Can you find information from the same documents in other document libraries, when using the default search scope?
Can you find information from this document library using the default search scope?
Are you trying to create a custom search results page, or just scope?
One thing to try is to check the search crawl log to see if there were any errors when it was searching the library.

Sharepoint: Image field with a link

I would like to add a field to a list with displays an Image, but acts as a hyperlink. In other words like the "Hyperlink or Picture" column, but "Hyperlink AND Picture" instead.
Where the two fields you input would be the URL to the image to display, and the URL of the hyperlink.
This must be possible. I notice that the Type (in a document library) column does just that, and also includes the views that are currently being used (in the case of a folder).
Is it possible to duplicate the computed Type field in a document library to read two other fields in the list (which will act as the image url, and the redirect link)? What would the CAML be?
Thanks in advance if anyone could offer any insight.
Arnhem
This can be done but you would need to develop a custom field type. As you have found, SharePoint's default rendering for pictures is without the hyperlink. You need to change how the rendering behaves in Display mode in your own custom field. Check Patterns in Custom Field Rendering for more info.
There are also several examples of creating custom field types on the web. The MSDN articles give a lot of detail about how it all works but don't let that put you off as it's not too tricky.

Resources