I wonder if there is a way to give a suggestion from the sphinx index.
for instance,
when I search 'sadfasasas' on google, I get 6 results.
and it said.' Do you mean "sasasasas".
when I search by 'sasasasas', I get 289,000 results.
How should I do to implement this feature? (Let's say the two keywords are all right
spelling. and I want to give the suggestion 'sasasasas' just because it's seems like
'sadfasasas', and it can find many results by sphinx ).
There are script, config, readme in sphinx/misc/suggest folder. You could try suggestion service out of the box.
Related
How can I create a services in Capella and call it in my M2DOC Word document?
I want, for example, create a services for print a functional tree, and use this code in many different documents without re-write every time the code.
Thank you a lot.
Stefania
It seems this section of the documentation explains what you want to do: https://www.m2doc.org/ref-doc/nightly/index.html#providing-new-services
As I understood from Mongodb documentation of text search.
if i want to search about Java or (coffee shop)
I need to do it like
{$text:{$search:"Java \"coffee shop\""}}
Exact Phrase search in mongodb documentation
so it should return all the documents contain Java or (coffee shop).
but it acts exactly as Java and (coffee shop).
so I think that i didn't get it right from the documentation.
so please.
I need clear explanation for why i got that result?
and
how to get the required output Java or (coffee shop)?
This is a known issue,
and is being tracker in SERVER-30163.
Not Solved yet so please go to SERVER-30163 to up-vote it.
I have application in Angularjs2, and developers have not been using ids into it. Now I have to implement the Protractor on same application. Is there anyway to implement the Protractor without using "absolute XPath"?
Thanks in advance!
Please find a huge range of locator-possibilities on the official Protractortest API Page
Every element on a page needs to be uniquely identifiable... else the page wouldn't work, no matter which technology. Therefore with the help of any of the above provided locator-possibilities you'll always find the element you're looking for.
And there is never a need for XPath, except for this only one. (though there is an parentElementArrayFinder introduced in the meantime, so not even that one exception is valid anymore)
UDPATE
If you could use XPath, you can for sure use CSS-Locators.
Here some examples for locators:
$('div.class#id[anyAttribute="anyValue"] div.child.somewhere-below-div-point-class')
element(by.cssContainingText('div[data-index="2"]', 'select this option'))
Or as a specific example the "Learn More" of the "Tree List" section of https://js.devexpress.com/ :
treeListSection = element(by.cssContainingText('div.tab-content h2', 'Tree List')).getDriver();
learnMoreBtn = treeListSection.element(by.cssContainingText('a.tab-button','Learn More'));
learnMoreBtn.click();
Those are just examples, but there is always a way to do it.
If you provide some example-HTML in your Question, I can direct you towards a solution.
UPDATE 2
For getting the Parent Web Element, one could use getDriver() as well
Im using thinking sphinx and libstemmer (pt-BR).
My problem is:
When I search "banheira" or "banheiras" sphinx gets the same results that matches with
"banheiro"/"banheiros".
Im trying to unlink the words "banheira" and "banheiro" because they are not the same
thing.
I didn't find any solution for this.
Anybody had the same problem?
Thanks!
Regards (:
Copied from: http://sphinxsearch.com/forum/view.html?id=11946
Read the docs on wordforms:
http://sphinxsearch.com/docs/current.html#conf-wordforms
can be used to implement 'stemming exceptions' :)
I've been implementing a RESTful web service which has these operations:
List articles:
GET /articles
Delete articles (which should remove only selected articles to a trash bin):
DELETE /articles
List articles in the trash bin:
GET /trash/articles
I have to implement an operation for restoring "articles" from "/trash/articles" back to "/articles".
And here is the question. Ho do you usually do it? What url do I have to use?
I came up to the 2 ways of doing it. The first is:
DELETE /trash/articles
But it feels strange and a user can read it like "delete it permanently, don't restore".
And the second way is
PUT /trash/articles
Which is more odd and a user will be confused what this operation does.
I'm new to REST, so please advice how you do it normally. I tried to search in google but I don't know how to ask it right, so I didn't get something useful.
Another option could be to use "query params" to define a "complementary action/verb" to cover this "special condition" you have (given that this is not very easily covered by the HTTP verbs). This then could be done for example by:
PUT /trash/articles?restore=true
This would make the URI path still complaint with REST guideline (referring to a resource, and not encoding "actions" - like "restore") and would shift the "extra semantics" of what you want to do (which is a very special situation) to the "query parameter". "Query params" are very commonly used for "filtering" resources in REST, not so much for this kind of situation... but maybe this is a reasonable assumption given your requirements.
I would recommend using
PUT /restore/articles
or
PUT /restore/trash/articles
Late answer but, in my opinion, the best way is to change the resource itself.
For instance:
<article is_in_trash="true">
<title>come title</title>
<body>the article body</body>
<date>1990-01-01</date>
</article>
So, in order to remove the article from Trash, you would simple use PUT an updated version of the article, where is_in_trash="false".