Allowing search through tags? - search

There is an HTML form through which a user creates an item. Items are searched using usual sql query. Now a tag field will be supplied for each item on the HTML form. So while creating an item the user will enter a tag name for the item and the item will be created along with the tag name. User will then use this tag name to search for items.
What could be the best way to implement this? Is adding a tag column to every Item table a good way of doing it? What are the other possible options?

I believe you would want to minimize round trips to a database server. Tags would likely be an attribute of one of the items of interest and it is a many to many relationship. This is a well trodden path and you can find more information here.

If you want to be able to add multiple tags, then the best way would be to implement a table like this:
item_tag
item_id - Integer
tag_name - Varchar
or two tables:
item_tag
item_id
tag_id
tags
id
name
Use the post_tag table to contain a list of which tags are associated with which item. If you want to search for items by tag, then you could do a
SELECT * FROM `items` LEFT JOIN `item_tag` ON `items`.`id` = `item_tag`.`item_id` WHERE `tag_name` = 'value'
Here is a post discussing the best way to implement a tagging system, which suggests using three tables; e.g., items, tags, items_tags

Related

Netsuite. Saved Search, how to join another table

I'm trying to make Saved Search which has Transaction fields that I want to join any other type's fields.
When I make Criteria, Result in Saved Search, I realized there is limitation to bring certain field.
I know the Type & Internal ID, so I used formula(numeric) and insert custom_item.realamount(This is actually what I want to know). But this wasn't show a value.
How can I make these two types to join each other?
There is no field in Netsuite called custom_item If you are trying to join a custom item field on a transaction search formula field then you'd be looking at a join like
{item.custitem_uniquepart_}
Where _uniquepart_ is either an integer if the custom field was created without a custom id value or it's the value entered for the id field of the custom field.

How to search for specific items in a SharePoint list?

I want to know if there is a way to search a sharepoint list for specific items. So in my list there is around 4,000 items, each with a specific Issue ID, the searchbar in the top left does not search for the issue ID it searches for something completely different as it never returns the correct item. IssueID is the first colum in the list.
At the moment, I'm having to export the list to excel and use CTRL+F to find specific items. Is there any possible way of changing the search bar so that it serahces for Issue ID?
You need to add the column to the search schema so it is indexed, otherwise the column wont be pulled into the search results.
There's a guide here: https://blogs.technet.microsoft.com/o365totd/2015/12/11/using-site-columns-to-create-searchable-metadata-in-sharepoint-online-office-365/

tag count on collection

I want to copy feature from stackexchange sites: every time you have list of questions, on the right side there is a list of all tags presented in them, including their count (frequency).
Is there any performance friendly way, how to obtain this kind of information without iteration through every element in view? Let's suppose it should work with common view data source, and content of the view can be altered by filter (keys, category) or fulltext.
I have already have considered (and refused) few solutions:
Iterate through collection - unusable for performance reasons (especially if ViewNavigator can't be used - FT query).
Counting tags in rendered content - limited to visible page only, tags for other pages are not counted (stackexchange counts tags for every page). Good performance though.
DocumentCollection.intersect - iteration through all tags and intersecting collections of all documents with that tag against source collection would result in count of documents with such tag. This approach is performance killer.
You could use a categorized view with a summary column and query it in json. Needs to be collapsed. ?ReadViewEntries&Outputformat=json
I would consider two basic approaches:
Store the tags in a multi-value summary text field in your question documents, create a categorized view based on that field, open the view, create a NotesViewNavigator, use CreateViewNavFromCategory to create a NotesViewNavigator that only contains the documents that match the tag, and get the NotesViewNavigator.count() property value.
Store the tags in a field (it can be multi-valued or single-valued, summary or non-summary text or even a rich text field) in your question documents, full text index the database, and use the Database.FTSearch method with a search formula that uses the FIELD keyword to get a NotesDocumentCollection, and use the NotesDocumentCollection.count() property.
For filtering, I think the latter approach may be better. You might be able to just revise your FT query to include additional conditions to accomplish the filtering. This could be very flexible, and should be pretty fast. With NotesViewNavigator, on the other hand, you would have to iterate through the NotesViewEntry objects in order to do the filtering.

Joining sharepoint 2007 lists in a web view based on a common key field

So - I'm making a data view that is to contain a list. This list has a field that will be used to match up against two other lists. If there is an entry for this value, it should show the value from the other list, otherwise show a link to add a new one.
So, what I need to do is make a data source consisting of the rows from list 1, and fill in the Ticket field with a value from the Tickets table matching the ID value from list 1. The same should be done for the Change Type field.
Can anyone point me in the right direction to accomplish this? I've found a few tutorials, but they seem to be for showing all the data together and not match up on any specific columns for linkage.
Thank you
What you are aiming at is not available in SharePoint out of the box.
There are two approaches you can look at:
Create your own custom lookup field template for single/multiple field
selection with some sort of field
editor. Create your own controls and
program the associated code behind
logic.
Use some existing custom solutions. One such sample is on codeplex:
SharePoint Filtered Lookup Field

Performing join between document library and list

I have a document library where i have columns called Title and Category(is a lookup field) and User.Also,I have a list where i am just storing categories. I would like to join both document library and list so that i can dispaly all categories and the documents associated with it. once i get everything i would like to perform filtering so that it dispalys only selected user's documents.The displaying of the documents is working fine but not filtering. My questions is CAn we perform join between doc library and list? Plesae help me.
Thanks
The content query web part (CQWP)is probably the easiest way to do this without code. Since you only have one field in your lookup (categories) you don't need to do a join as SharePoint stores the lookup value in the Document Library. You will need to edit your CQWP to add this field, there is a good tutorial on doing this here. It also explains how to filter your CQWP.
Finally you will need to clean up your lookup field as SharePoint will store the value like this: 1;#Category1.
The CQWP uses XSLT to display the results so in your case you probably don't want to show 1;#Category1 you probably only want to show Category1. You can use the following XSLT to accomplish this:
<xsl:value-of select="substring-after(#Name_Of_Your_Lookup,'#')"></xsl:value-of>

Resources