Tagging item according to keywords

hi

is there any algorithm for tagging an item with the keywords and searching them according to these keywords.

for example, in a library, a Java programming book can be tagged with the keyword "java, programming, object oriented".

so, when a user search with any of these keyword, that book will be returned in the result.

regards

terence

[377 byte] By [mtzo81a] at [2007-10-3 8:16:56]
# 1

generally this is called an index. Just like the index of a book where you look up a word and find a list of which pages that word lives on.

In a database you could keep a table where each row is a pair, a tag and a data item. If you querry this table on a single tag your drop is all the data items that matched the tag.

Presumably in memory you could do the same thing. Your index would be something like a Map where the keys are strings and the data element associated with a single key is a list of objects that match that tag.

I wouldn't exactly call this an algorithm it is more a data structure and how you do it depends more on where you do it. You were not clear on whether you are trying to tag items in a database or what.

marlin314a at 2007-7-15 3:22:09 > top of Java-index,Other Topics,Algorithms...
# 2
hithanks for your reply....i'm not using database. i'll create a class for items.by indexing, do u mean that i need to create a hashtable/map before i search?regardsterence
mtzo81a at 2007-7-15 3:22:09 > top of Java-index,Other Topics,Algorithms...