What fields does SDL Tridion 2011 search use? - tridion

I have never had practical success when using the search feature in Tridion (SDL Tridion 2011). I am looking at a list of components. I enter some of the text for one those component's name and the search does not find it. I have to use the exact name of the component for it to find it.
What fields does it search using my criteria?
Is there a wild card symbol I can use or a setting to make it a "contains" query?

The Search Indexer should index all fields of every components as well as text in binaries (PDFs, MS Word Docs etc). I have a running instance of SDL Tridion 2011 and can confirm that it does in fact give results from both binary and normal component content.
I am not entirely sure of the inner workings of the newer SolR version of Tridion, but I imagine that Titles and Full text are indexed separately.
It could be that your indexer is not actually running properly, I have seen the service appear to be in the running state, but not actually processing messages in the Search Queue. Try opening the Purge Queue tool (Normally located at "C:\Program Files (x86)\Tridion\bin\TcmPurgeQueue.exe"), and see if there are lots of messages waiting in the Search Queue. If there are, it may be that items are not being processed properly, try hitting refresh and see if the number is going down.
For a wildcard, you should just be able to use a '*'. I just tested putting the string "Rampusplong" in a component filed, and can confirm that searching for "Rampusplong" or "Rampus*" or "*ampusplo*" return my result, but "Rampus" returns no results.

Yes, * for wild cards as Chris mentions. See some reserved word options below (source: the SDL Welcome "Getting to Know SDL Tridion" help pages) for other options to try.
identifier (e.g. tcm:19-123-8)
search operators
AND
OR
NOT
IN (e.g. "someword IN title", where title is the component's XML)
exact phrases delimited with " (e.g. "Mad cookie")
wildcards
* for wildcard, multiple characters (I've sometimes needed this on supposed full matches)
? for single
special characters
+ - ! ( ) { } [ ] ^ " ~ * ? : \
(help file doesn't say much more except to escape with double quotes)
reserved words (escape with \ regardless of capitalization)
CONTAINS
NEAR
SENTENCE
PARAGRAPH
PHRASE
IN
MATCHES
STARTS
SUBSTRING
ENDS
AND
OR
NOT
You can also search in multimedia as well as metadata, schema, and the other visible search options by clicking on the advanced search (down arrow next to search).
At least in older versions (R5.3 specifically and possibly 2009), I've seen items outside of regular creation (via VBScript) skip getting indexed. Re-index if that's the case, but not sure with 2011.

Related

Search method in Smartsheet API 2.0 C Sharp

Within the API for smartsheet I use the search everything method.
Already solved in cUrl (check Special characters in Smartsheet API (2.0) - search), but within C-sharp how can I solve this:
When trying to search for 'A01 PXXX' it returns me also rows (and cells) which contain only 'A01' and 'PXXX'. Is there a way to search for the whole searchstring (so including the space character). Unicode "\u0020" or "%20" do not seem to work. Anyone ?
Did you try putting the whole search string in double quotes(i.e. "\"A01 PXXX\"")?

How to verify a text is present on a webpage for 'n' times

I wanted to verify a text in a webpage exist for 2 times or ‘n’ times. I have used “Page Should Contain” keyword but it says “Pass” when it identifies single occurrence. I don’t want to verify using locator.
Ex: I want to verify the text "Success" is available in a current webpage for 3 times using robot framework
Any inputs/suggesstions would be helpful.
Too bad you don't want to use a locator, as robotframework has a keyword just for that:
Xpath Should Match X Times //*[contains(., "Success")] 2
The caveat is the locator should not be prepended with xpath= - just straight expression.
The library keyword Page Should Contain does pretty much exactly that, by the way.
And if you want to find how many times the string is present in the page - easy:
${count}= Get Matching Xpath Count //*[contains(., "Success")]
And then do any kind of checks on the result, e.g.
Should Be Equal ${count} 2
I thought the problem of not using locator sounds fun (the rationale behind the requirement still unclear, yet), so another solution - look in the source yourself:
${source}= Page Source # you have the whole html of the page here
${matches}= Get Regexp Matches ${source} >.*\b(Success)\b.*<
${count}= Get Length ${matches}
The first one gets the source, the second gets all non-overlapping (separate) occurrences of the target string, when it is (hopefully) inside a tag. The third line returns the count.
Disclaimer - please don't actually do that, unless you're 100% sure of the source and the structure. Use a locator.

Visual FoxPro 9.0 report show unicode

I am using Visual Foxpro 9, I want to print Unicode chars in report (frx).
There are some ways to extend report listener to show unicode. I need the code to extend/show reportListner to show unicode.
I've never had to work with Unicode within VFP either, or spent any time working with Reports, but the Help for the Render method of the ReportListener does mention Unicode:
cContentsToBeRendered
Indicates the text to be rendered for Expression (Field) and Label layout elements.
For Picture layout elements sourced from a file, cContentsToBeRendered contains the filename.
When specifying a filename for an image, ReportListener provides cContentsToBeRendered
as a DBCS string, which is the standard format for strings in Visual FoxPro.
However, when indicating text to be rendered, ReportListener provides
cContentsToBeRendered as a Unicode string, appropriately translated to the correct
locale using any regional script information associated with this layout control in
its report definition file (frx) record.
If your derived class sends the text value through some additional processing, such as
storage in a table, you can use the STRCONV() function, and its optional regional
script parameter, to convert the string to DBCS first. For more information, see
STRCONV( ) Function.
Although I could be incorrect, but I believe VFP does NOT support UniCode and only works with the base ASCII character set. But then again, I've never needed to use Unicode either and have used FoxPro since the beginning of its lifetime.
I would imagine Rick Strahl's article Using Unicode in Visual FoxPro
Web and Desktop Applications would be fairly definitive on the topic.

How to construct complex Google Web Search query?

Searching through the Web by using the Google search engine is a de facto standard for Internet users.
Google provides a basic or an advanced form to prepare a query string to its search engine. Supposing to be interested in not using the web form, one can simply do an HTTP get request to the specific URL with a query string constructed upon the search conditions.
For instance I can search for results with word "hello" by doing an HTTP request at:
http://www.google.com/search?q=hello
I can add another word, e.g. "world", as follows:
http://www.google.com/search?q=hello+world
You know, the search can be more "complicated" by specifying nice parameters like:
or condition(s)
exact phrase(s)
search on specific domain(s)
avoid a specific word(s)
search with a specific language
limit search by geographical area
search for document type
etc.
How can I modify the query string to account for the above search parameters?
I carefully examined the answers by Pratik Chowdhury and Robbie Vercammen. They provides a link to Web documents that report a list of possible textual filtering to be used within the Google search form. Despite this is interesting, they don't provide an answer to the question. Hence, I studied a lot the problem and I found the following solution.
Suppose that you need to make a una tantum HTTP call (e.g. by a PHP class runned via CRON once a month) to Google Search in order to retrieve the search results for a particular string query, e.g. all the pages with some words (i.e. "hello" and "world") in your website (i.e. mywebsite.com), then you can do an HTTP get call to the following address:
http://www.google.com/search?q=hello+world+site:mywebsite.com
The q parameter can contain the whole search query, however Google defined a dummy proof list of parameters.
Notice that the AND operator can be represented by the as_q parameter instead.
To get page results with one between "hello" and" world" (i.e. and OR), must be changed the query "q" parameter as:
q=hello+OR+world
while a more compact representation uses the as_oq parameter:
as_oq=hello+world
If one looks for the exact phrase "hello world", the q parameter is:
q="hello+world"
while, again, another compact representation uses the as_epq parameter:
as_epq=hello+world
If one looks for all the results that not contain the words "hello" and "world", the q parameter is:
q=-hello+-world
while, again, another compact representation uses the as_eq parameter:
as_eq=hello+world
Of course, as_q, as_oq, as_epq, as_eq, etc. can by combined in a unique search query as usual (i.e. by using the & character). Thus, for instance I can search for both words "hello" and "word" plus one between "programming" and "code" as follow here:
q=hello+world&as_oq=programming+code
One can search for a specific domain (again, mydomain.com) as follow:
as_sitesearch=mydomain.com
However, if you want to exclude a specific domain (e.g., because it is a spam source), you must recur to standard notation. E.g.:
q=hello+-site:mydomain.com
return all the pages with word "hello" that are not in site mydomain.com.
To get for a specific file type, e.g. a pdf, you can use as_filetype:
as_filetype=pdf
More complex search parameter can be used, as provided in Google support docs.
For instance, to get also results with a synonym of a word, simply use the ~ operator in front of the word, e.g.
q=~hello
Moreover, if you want to use wildcards, e.g. to get all the exact phrases that start with "hello" and end with "world", you should use the * operator:
q="hello+*+world"
which probably will return something like: "hello to the world" and "hello sweet world".
One can also search for specific words inside the page title or in the page url by using the following keywords (read here for more details):
intitle
allintitle
inurl
allinurl
For instance, the following returns all the pages s.a. both words "hello" and "world" are in the url:
q=allinurl:hello+world
For the language of the Google GUI page (not the one of the results), one must insert into the query string the language string (e.g. en for English, fr for French, it for Italian, etc.) to the hl parameter. In other words, if one search with the English version of Google, the query string becomes as follow:
http://www.google.com/search?hl=en&q=hello+world+site:mywebsite.com
To select a specific language, e.g. Italian, use the lr query parameter:
lr=lang_it
One can also select pages published in a specific geographical region by using the cr parameter. E.g., to find all the pages published in Italy:
cr=countryIT
To create complex and / or queries, you can use () and OR.
For example if we want to search for
("tschakk buff" AND "boom bang") OR ("zata tong" AND "zong klirr")
The query would look like this:
https://www.google.com/search?q=("tschakk%20buff"%20"boom%20bang")%20OR%20("zata%20tong"%20"zong%20klirr")
though this books title seems dangerous but anyway it will answer all your questions if u don't misuse it.
The name of the book is "Dangerous Google – Searching for Secrets" by Michał Piotrowski by some hackin9 magazine.
Wish ya luck
If you are trying to assemble your own url by manually typing the url before using it, this site should prove helpful: http://www.googleguide.com/advanced_operators.html
Advangle is a nice free service where you can construct web-search queries visually and get a query string (or URL to Google and Bing) as the result.

AppleScript to download files from HTTP server, mutating the URL?

I've never messed with AppleScript so this is only a concept to me. Can this work?
Bungie, the game designer, is hosting a ton of PNGs for Halo Reach in systematically named files and directories. IE:
http://www.bungie.net/images/reachstats/commendations/onyx/onyx_large_precision_multiplayer.png
Change two instances of the same word, and you generate another version of the image. Change "onyx" to "iron", "bronze", "silver" or "gold" and you get a corresponding image, like so:
http://www.bungie.net/images/reachstats/commendations/gold/gold_large_precision_multiplayer.png
Would an AppleScript be able to take an input URL, find and change the instances of the words in the URL, and then download the associated file to a directory? Today is my birthday (Oct 27th! hence the XXVII) and if this will work I would be super excited if someone could make this!
Thanks for all of your kind answers!
This works:
set the destination_file to ((path to desktop as string) & "picture.jpg") as file specification
set thisImageSRC to "http://www.bungie.net/images/reachstats/commendations/gold/gold_large_precision_multiplayer.png"
tell application "URL Access Scripting"
download thisImageSRC to destination_file replacing yes
end tell
String manipulation is done completely with changing Applescript's text item delimiters. So to get the components of the URL into a list, you need to do the following:
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to "/"
set theUrlComponents to (every text item of theURL) as list
set AppleScript's text item delimiters to oldDelims
Add salt to taste, but I agree with the first commenter that there are better languages to do this. Applescript would be my last choice here.

Resources