Have recently answered this here → Internet lookup.
The solution is to use a macro. The text is highlighted then a right click and select Google_search. Have just retested this on Mint 18.3 using LO v 184.108.40.206 and have no problems.
Sample (macros included) — InternetSearch.odt
Please refrain from comments such as
Google Docs does this.... It doesn’t matter who else does what. If LO doesn’t do something then a request should be made on Bugzilla.
Sorry but I should have mentioned that the macro in the sample is set to use Firefox. If you use a different browser, the macro must be changed.
Not certain why you are having the problem. Have taken this same sample and it obtains whatever is highlighted each time:
Edit #2 2018-09-29:
On the original site where the code is posted, there is a second routine (similar to the first). This one uses the default browser. Also, if a word/phrase is not selected it will search on the word the cursor is on or nearest to.
Sample #2 ---- InternetSearch2.odt
Edit #3 2018-09-29:
From menu →
Tools->Customize and on
Context Menus tab:
Notice on left panes the
Category of Macros was selected from dropdown list (near bottom). This list the macros available in your document & for the modules. If you want this to be available across ALL Writer documents, you should place the macro in
My Macros before assigning this. In the right panes notice my scope was for the document. You could choose Writer. The
Text. Once you select the macro wanted and the target, use the arrow (middle section) to create an entry on the right. You can use the
Modify button to give it a new name . You can also use the up/down arrows on the far right to move the entry in the list of items.